PHP MySQL problems

Discussion in 'Computer Support' started by *** HAWK, Oct 25, 2003.

  1. *** HAWK

    *** HAWK Guest

    Can anyone explain this error - I am trying to setup PHP/Apache/MySQL on my
    home machine (Winxp pro)
    I have got everything working now - I know MySQL works cos I am able to run
    the MySQL monitor through the command prompt. But when I run the following
    php file (see text below as contained in the php file) IE returns the
    following error -
    Parse error: parse error, unexpected T_STRING in
    C:\Apache\htdocs\mysqltest.php on line 8

    PHP Script
    <head> <title>MySQL Connection Test</title> </head>

    $connection = mysql_connect("localhost","root","") or

    die("Sorry - unable to connect to MySQL");
    echo(Congratulations - you are connected to MySQL");

    *** HAWK, Oct 25, 2003
    1. Advertisements

  2. Above's your error, you are missing quotes in front of Congratulations:

    echo("Congratulations - you are connected to MySQL");

    Janwillem Borleffs, Oct 25, 2003
    1. Advertisements

  3. *** HAWK

    *** HAWK Guest

    Thanks i'm soo stupid sometimes :)
    Cheers mate
    *** HAWK, Oct 25, 2003
  4. *** HAWK

    HamMan Guest

    ah, thats why i like using the PHP / Apache system, it actually tells you
    where the error is unlike so mnay other web programming languages.
    HamMan, Oct 25, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.