Q695 Posted February 17, 2009 Share Posted February 17, 2009 output: sql error sql : SELECT * FROM criteria WHERE id='2'; <?php $sql="SELECT * FROM criteria WHERE id='$row_id';"; $result=@mysql_query($sql,$con) or die(death($sql)); //get the results $row_pull=@mysql_fetch_array($result);?> Link to comment https://forums.phpfreaks.com/topic/145521-solved-good-sql-but-dying/ Share on other sites More sharing options...
Lodius2000 Posted February 17, 2009 Share Posted February 17, 2009 try <?php $sql="SELECT * FROM criteria WHERE id=".$row_id; $result=@mysql_query($sql,$con) or die(death($sql)); //get the results $row_pull=@mysql_fetch_array($result);?> you dont need a ; in a sql statement, thats only in raw sql Link to comment https://forums.phpfreaks.com/topic/145521-solved-good-sql-but-dying/#findComment-764005 Share on other sites More sharing options...
Q695 Posted February 17, 2009 Author Share Posted February 17, 2009 That was the exact same thing lodius Link to comment https://forums.phpfreaks.com/topic/145521-solved-good-sql-but-dying/#findComment-764007 Share on other sites More sharing options...
Q695 Posted February 17, 2009 Author Share Posted February 17, 2009 It was trying to pass $con into the function when it's not assigned Link to comment https://forums.phpfreaks.com/topic/145521-solved-good-sql-but-dying/#findComment-764010 Share on other sites More sharing options...
Lodius2000 Posted February 17, 2009 Share Posted February 17, 2009 my bad... as it was a snippet I was assuming $con was defined Link to comment https://forums.phpfreaks.com/topic/145521-solved-good-sql-but-dying/#findComment-764246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.