webtuto Posted January 9, 2008 Share Posted January 9, 2008 hi what is the problem in this code ---> <?php include("config.php"); $get=$_GET['cat']; $sql="SELECT * FROM `tuto` where group='$get' "; $res = mysql_query($sql) or die('Database error: ' . mysql_error()); while($row=mysql_fetch_array($res)) { echo "The title is ".$row[title]."<br>"; echo "The resume is ".$row[resume]."<br>"; echo "Written on ".$row[date]."<br><br><br><br>"; } ?> the error ---> Database error: 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 'group='Photoshop'' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/ Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 GROUP is a mysql reserved word. Rename the filed or use backticks around it `group` Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/#findComment-434794 Share on other sites More sharing options...
webtuto Posted January 9, 2008 Author Share Posted January 9, 2008 thanks man u helped me a lot Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/#findComment-434805 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 At least you had the error ready to go Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/#findComment-434808 Share on other sites More sharing options...
webtuto Posted January 9, 2008 Author Share Posted January 9, 2008 yeah u must be good in php Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/#findComment-434832 Share on other sites More sharing options...
drummer101 Posted January 9, 2008 Share Posted January 9, 2008 At least you had the error ready to go refreshing eh? Quote Link to comment https://forums.phpfreaks.com/topic/85229-plz-a-select-error-need-help/#findComment-434833 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.