Jump to content


Photo

Database login variable parse error


  • Please log in to reply
2 replies to this topic

#1 rob.lowe

rob.lowe
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 August 2006 - 04:51 AM

I receive this error:

Parse error: parse error, unexpected T_VARIABLE in C:\websites\phptest\database\db_login.php on line 3

when I attempt to connect to a local database.

Here is the code I am using:

<?php
    $db_host='localhost'
    $db_database='bookstore';
    $db_username='root';
    $db_password='******';
?>

Line 3 in this case happens to be $db_database, The database does exist as I can edit it via MySQLAdmin.  I dunno what do do. I will provide any more info needed, I am running a windows test machine with php.1.4, and the most recent stable versions of apache and mysql.

Thanks!

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 August 2006 - 05:11 AM

$db_host='localhost'; // add the missing semi-colon
Legend has it that reading the manual never killed anyone.
My site

#3 rob.lowe

rob.lowe
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 August 2006 - 01:17 PM

Well now I feel silly, thanks much, everything works now.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users