Syntax Problem?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Sanderson

    #1

    Syntax Problem?

    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";

    ?>
  • Bob Sanderson

    #2
    Syntax Problem - correction

    Bob Sanderson <sandman@LUVSPA Msandmansoftwar e.com> wrote in
    news:Xns974094A CCE5ADcentroidi ncearthlink@207 .69.189.191:

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

    Comment

    • Bob Sanderson

      #3
      Re: Syntax Problem?

      Disregard this post - I'm an idiot

      Comment

      Working...