smti Posted March 29, 2008 Share Posted March 29, 2008 Hello, I could use a bit of help. I get the following error when testing my script: Parse error: parse error, unexpected T_ECHO in /web/login/process.php on line 14 Here is my code: <? // Connect to database $connection = mysql_connect("localhost","root",""); if (!$connection) { die('Could not connect: ' . mysql_error()); } $sql=("select * from users where username='$_POST[username]' and password='$_POST[password]' ")); $result=mysql_query($sql) echo sql; ?> Thanks, smti Link to comment https://forums.phpfreaks.com/topic/98437-a-simple-problem/ Share on other sites More sharing options...
beebum Posted March 29, 2008 Share Posted March 29, 2008 Look at the parentheses in your sql statement. Link to comment https://forums.phpfreaks.com/topic/98437-a-simple-problem/#findComment-503768 Share on other sites More sharing options...
MasterACE14 Posted March 29, 2008 Share Posted March 29, 2008 missing semicolon ( ; ) $result=mysql_query($sql); Regards ACE Link to comment https://forums.phpfreaks.com/topic/98437-a-simple-problem/#findComment-503771 Share on other sites More sharing options...
keeB Posted March 29, 2008 Share Posted March 29, 2008 2 problems in 2 lines. $result=mysql_query($sql) echo sql; should be $result=mysql_query($sql) ///missing ; echo sql; ////////// missing $ Link to comment https://forums.phpfreaks.com/topic/98437-a-simple-problem/#findComment-503773 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.