Jump to content

Unknown Error


Alicia

Recommended Posts

Hi,

 

i am trying to run this script but encounted an unknown error .. can somebody give me an idea whats wrong with my php mysql code

$mysett = "'".$myopt[0].','.$myopt[1].','.$myopt[2].','.$myopt[3]."'";
$prescho = mysql_query("SELECT *FROM stud WHERE `d_type_id`IN ($mysett) AND `disp_homep` = 'yes'
AND STR_TO_DATE(join, '%d/%m/%Y' ) <= CURDATE( )
AND STR_TO_DATE( left '%d/%m/%Y' ) > CURDATE( )
ORDER BY FIELD( `d_type_id` , $mysett ) , `Deal`.`join` DESC");

 

no error or record displayed in the page even there are records match the condition... please help

Link to comment
https://forums.phpfreaks.com/topic/269698-unknown-error/
Share on other sites

Both "join" and "left" are reserved MySQL keywords and must be enclosed in `backticks`. You're also missing a comma after "left"

 

The reason why you're not getting an error is because you're probably not checking the results of your queries and actually displaying errors. MySQL errors must be handled and displayed by your PHP, since SQL is a separate language run on a separate server.

Link to comment
https://forums.phpfreaks.com/topic/269698-unknown-error/#findComment-1386451
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.