Strange mysql problem, please teach PHPcode $ SQL & quot; select * from {$ BIAOTOU} lottery_resultwhereto_days (now () to_days (lotterydate) andusername {$ _ SESSION [& quot; duoduouser & quot;]} andlotteryid mysql is a strange problem.
PHP code
$ SQL = "select * from {$ BIAOTOU} lottery_result where to_days (now () = to_days (lotterydate) and username = '{$ _ SESSION ["duoduouser"]}' and lotteryid = {$ lotteryid} "; echo $ SQL; exit;
Output
? Select * from duoduo_lottery_result where to_days (now () = to_days (lotterydate) and username = 'wzxinchen' and lotteryid = 23
Let's try to analyze this sentence with the command line to see if the syntax is too close.
I cannot even use the syntax here.
If I rewrite the word 'select', I will pass the record. why? All codes are unified.
------ Solution --------------------
If you change the select statement, you will be able to understand it.