Phpmysql data query problem-it is not easy to use with Where. I do not know what is wrong $ query_CN & quot; SELECTPestcide_trade_namefrominsecticidewhereCompany_nameBayer & quot; $ q_result_CNmysql_query ); & nbs php mysql data query problems-adding Where is not useful, I do not know what is wrong
$ Query_CN = "SELECT Pestcide_trade_name from insecticide where Company_name = Bayer"; $ q_result_CN = mysql_query ($ query_CN );
While ($ each_ques_CN = mysql_fetch_row ($ q_result_CN ))
{
Print $ each_ques_CN [0];
}
If I do not add a where clause, $ query_CN = "SELECT Pestcide_trade_name from insecticide. If it is added, the following Warning will be reported
Warning: mysql_fetch_row (): supplied argument is not a valid MySQL result resource in d: \ apm_setup \ htdocs \ search. php on line 33
Line 33 is the line while ($ each_ques_CN = mysql_fetch_row ($ q_result_CN). What is this. Thank you.
------ Solution --------------------
$ Query_CN = "SELECT Pestcide_trade_name from insecticide where Company_name = 'bayer '";
------ Solution --------------------
Discussion
$ Query_CN = "SELECT Pestcide_trade_name from insecticide where Company_name = 'bayer '";
------ Solution --------------------
... Where Company_name = '$ name '";