I am trying to write a front end for a MySql database and can't get it to
work. I seem to be missing something fundemental. The code below works fine
and returns an HTML page with the desired output. However, it I remove the
"#" from the two lines which are commented out, I get a blank page as an
output. Can anyone see anything I'm doing wrong?
Any help will be greatly appreciated.
<?php
$link = mysql_connect(" localhost","roo t","foobar") ;
if(! $link)
die("Could not connect to MySQL");
else
print("Connecte d to MySQL server<P>");
$database = "centroid";
mysql_select_db ($database)
or die ("could not open $database: ".mysql_err or() );
print "Opened database \"$database\"<P >";
$query="select * from jobs where JobNumber like 5178";
# $result=msql_qu ery($query);
# echo "<p>The Job Number is "$results"</p>";
mysql_close($li nk);
print "Everything works";
?>
work. I seem to be missing something fundemental. The code below works fine
and returns an HTML page with the desired output. However, it I remove the
"#" from the two lines which are commented out, I get a blank page as an
output. Can anyone see anything I'm doing wrong?
Any help will be greatly appreciated.
<?php
$link = mysql_connect(" localhost","roo t","foobar") ;
if(! $link)
die("Could not connect to MySQL");
else
print("Connecte d to MySQL server<P>");
$database = "centroid";
mysql_select_db ($database)
or die ("could not open $database: ".mysql_err or() );
print "Opened database \"$database\"<P >";
$query="select * from jobs where JobNumber like 5178";
# $result=msql_qu ery($query);
# echo "<p>The Job Number is "$results"</p>";
mysql_close($li nk);
print "Everything works";
?>
Comment