Syntax Problem?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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.


$link = mysql_connect("localhost","root","foobar");
if(! $link)
        die("Could not connect to MySQL");
        print("Connected to MySQL server<P>");

$database = "centroid";
        or die ("could not open $database: ".mysql_error() );
print "Opened database \"$database\"<P>";

    $query="select * from jobs where JobNumber like 5178";
    # $result=msql_query($query);
    # echo "<p>The Job Number is "$results"</p>";

print "Everything works";


Syntax Problem - correction

The line
        # echo "<p>The Job Number is "$results"</p>";
should have single quotes around '$results'

Re: Syntax Problem?

Disregard this post - I'm an idiot

Site Timeline