Mysql_fetch_array (): suppliedargumentisnotavalidMySQLresultresource php invalid SQL result resource mysql
Jiangsu Nong agriculture and forestry Ecosystem Development Co., Ltd.
Include "conn/conn. php ";
?>
?>
Customer service | FAQs | farm experts | merchants | set to homepage
- First page
- The second generation of agriculture
- News Center
- Special breeding
- Green products
- Landscape Engineering
- Service Scope
- Human resources
- Customer Message
- Contact us
|
|
| News Center |
|
You are here: Homepage> News Center |
|
If ($ _ GET ['Identification ']! = Null ){$ SQL = mysql_query ("select * from frontpagenews where identification =". $ _ GET ['Identification ']. "order by createDate desc limit 0, 7 ");Here error while ($ result = mysql_fetch_array ($ SQL )){?>
|
|
|
}} Else { $ SQL = mysql_query ("select * from frontpagenews where identification = 1 order by createDate desc limit 0, 7 ");While ($ result = mysql_fetch_array ($ SQL )){?>
|
|
|
}}?>
|
Error message
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource in C: \ Apache \ htdocs \ growers \ news. php on line 147
Reply to discussion (solution)
$ SQL = mysql_query ("select * from frontpagenews where identification =". $ _ GET ['Identification ']. "order by createDate desc limit 0, 7 ");
Mysql_query ("select * from frontpagenews where identification =". $ _ GET ['Identification ']. "order by createDate desc limit 0, 7 ");
Unless the last character of $ _ GET ['Identification '] is a space, the value of $ _ GET ['Identification'] will not be connected with order?
If $ _ GET ['Identification '] = 1
No more SQL commands
"Select * from frontpagenews where identification = 1 order by createDate desc limit 0, 7"
?
Careless. Thank you. Less space