flaab Posted February 23, 2007 Share Posted February 23, 2007 Good morning =) I'm having a little problem retrieving a text field(not varchar) from a Mysql Table. Here is the code... $result=mysql_query("SELECT desc FROM `retosP` WHERE id = '$pid' "); Desc it's a text field. Every other fields just work fine. 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 'desc FROM `retosP` WHERE id = '' at line 1 How can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/39774-solved-mysql_query-retrieving-a-text-field-from-mysqlerror/ Share on other sites More sharing options...
paul2463 Posted February 23, 2007 Share Posted February 23, 2007 desc is a reserved word in mysql, try this <?php $result=mysql_query("SELECT `desc` FROM `retosP` WHERE id = '$pid' "); ?> Quote Link to comment https://forums.phpfreaks.com/topic/39774-solved-mysql_query-retrieving-a-text-field-from-mysqlerror/#findComment-192050 Share on other sites More sharing options...
flaab Posted February 23, 2007 Author Share Posted February 23, 2007 God bless you!! It worked. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/39774-solved-mysql_query-retrieving-a-text-field-from-mysqlerror/#findComment-192053 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.