?
2014-08-13 02:41:57 UTC
here is the php code so far:
echo "";
echo "";
echo "";
echo "
";
$test = "testdata!!!!";
echo "This is some: $test
";
//connection to the database
$dbcnx = mysql_connect("localhost", "user", "password")
or die("Unable to connect to MySQL");
echo "Connected to MySQL
";
//select a database to work with
$selected = mysql_select_db("udp",$dbcnx)
or die("Could not select examples");
//execute the SQL query and return records
$result = mysql_query("SELECT packetdata FROM data");
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo "Data:".$row{'packetdata'} //display the results
};
//close the connection
mysql_close($dbhandle);
echo "echo "";
?>
When I run this, the webpage remains completely blank. I'm new to php, is this a syntax error, or am I misunderstanding a principle here?
$test = "testdata!!!!";
echo "
This is some: $test
";//connection to the database
$dbcnx = mysql_connect("localhost", "user", "password")
or die("Unable to connect to MySQL");
echo "Connected to MySQL
";
//select a database to work with
$selected = mysql_select_db("udp",$dbcnx)
or die("Could not select examples");
//execute the SQL query and return records
$result = mysql_query("SELECT packetdata FROM data");
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo "Data:".$row{'packetdata'} //display the results
};
//close the connection
mysql_close($dbhandle);
echo "echo "";
?>
When I run this, the webpage remains completely blank. I'm new to php, is this a syntax error, or am I misunderstanding a principle here?