my connect.php code looks like this:
<?php
$db = mysql_connect ("localhost,"root","") or die ("could not connect to db");
if (!$db)
die ("no db");
if (!mysql_select_db("tutorial",$db))
die("No database selected");
?>
and for some reason it says there is a parsing error on line three when i try to run my registration.php (yes im following the guide on youtube)
I need help ASAP
( ! ) Parse error: syntax error, unexpected T_STRING in C:\wamp\www\Tutorial\Connect.php on line 3
Call Stack
# Time Memory Function Location
1 0.0007 362768 {main}( ) ..\Register.php:0
This is the error i get
Connect.php whats wrong?
Connect.php whats wrong?
Last edited by nilesa12 on Tue Feb 21, 2012 11:39 pm, edited 1 time in total.
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Connect.php whats wrong?
Code: Select all
<?php
$db = mysql_connect ("localhost,"root","") or die ("could not connect to db"); //missing quote after localhost
if (!$db)
die ("no db");
if (!mysql_select_db("tutorial",$db))
die("No database selected");
?>Try
Code: Select all
<?php
$db = mysql_connect ("localhost","root","") or die ("could not connect to db");
if (!$db)
die ("no db");
if (!mysql_select_db("tutorial",$db))
die("No database selected");
?>Re: Connect.php whats wrong?
wow thanks man
sorry i was being to quick to ask for outside help because im a loser!
sorry i was being to quick to ask for outside help because im a loser!
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm

