FURQAN Posted June 7, 2010 Share Posted June 7, 2010 hi there furqi here i have a problem of mysql in my code following is the code any help will b highly appreciated thanxxx <?php mysql_connect('localhost','root','') or die("cannot run"); mysql_select_db('normalisation') or die("cannot run"); $sql="SELECT a.id,t.correct FROM answertable a,table t WHERE a.rollnumber=t.rollno"; $result=mysql_query($sql) or die("cannot run"); ?> this code gives output "cannot run" i.e., die Quote Link to comment https://forums.phpfreaks.com/topic/204079-query-problem/ Share on other sites More sharing options...
fenway Posted June 7, 2010 Share Posted June 7, 2010 How about dumping mysql_error()? Quote Link to comment https://forums.phpfreaks.com/topic/204079-query-problem/#findComment-1068926 Share on other sites More sharing options...
ignace Posted June 7, 2010 Share Posted June 7, 2010 $result=mysql_query($sql) or die("cannot run " . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/204079-query-problem/#findComment-1068929 Share on other sites More sharing options...
FURQAN Posted June 8, 2010 Author Share Posted June 8, 2010 it is saying the following You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table t WHERE a.rollnumber=t.rollno' at line 2 thanxxx Quote Link to comment https://forums.phpfreaks.com/topic/204079-query-problem/#findComment-1069324 Share on other sites More sharing options...
fenway Posted June 8, 2010 Share Posted June 8, 2010 You called your table "table"? Bad idea -- don't use a reserved keyword. Quote Link to comment https://forums.phpfreaks.com/topic/204079-query-problem/#findComment-1069564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.