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? 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' "); ?> 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! 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
Archived
This topic is now archived and is closed to further replies.