PHP MySQL query data related issues-add where is not good, I do not know what is wrong
Source: Internet
Author: User
PHP MySQL Query data problem-plus where is not good, 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 where the above code $query _CN = "Select Pestcide_trade_name from Insecticide"; If you add it, 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 Li NE 33
Line 33 is the same while ($each _QUES_CN = mysql_fetch_row ($q _result_cn)). Thank you all first.
------Solution--------------------
$query _cn = "Select Pestcide_trade_name from insecticide where company_name= ' Bayer '";
------Solution--------------------
discuss
$query _cn = "Select Pestcide_trade_name from insecticide where company_name= ' Bayer '";
------Solution--------------------
... where company_name= ' $name ' ";
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service