Original link:
http://www.cnblogs.com/xiaoxiaff/p/3960693.html
Write php when the database interaction and a lot of problems, but solutions are also given tips are still very clear.
This error is the problem sql syntax of the statement is as follows:
select food_num from foodlist where food_name=$Fname
That phrase is food_name given data type varchar (255), when the matching type varchar matching string, and therefore will not be considered without the quotes string. Solution:
select food_num from foodlist where food_name='$Fname'
Similarly, in the update, insert and other statements also do the same process
Reproduced in: https: //www.cnblogs.com/xiaoxiaff/p/3960693.html