Data reading error conn. php & lt ;? Php $ conn = mysql_connect (& quot; localhost & quot;, & quot; mlstudio & quot;, & quot; ml902975 & quot;); mysql_select_db (& quot; db_bcty365 & quot;, $ co data reading error
Conn. php
$ Conn = mysql_connect ("localhost", "mlstudio", "ml902975 ");
Mysql_select_db ("db_bcty365", $ conn );
Mysql_query ("set names gb2312 ");
?>
Show page code
$ Sqluwz = mysql_query ("select * from tb_soft order by addtime desc limit 0, 7", $ conn );$ Infouwz = mysql_fetch_array ($ sqluwz );If ($ infouwz = false ){?>
|
No software is available for download! |
} Else {$ I = 1;Do {?>
|
"Class =" a1 "> If ($ I = 1) { Echo ""; } Echo unhtml (msubstr ($ infouwz ["softname"], 0, 16 )); If (strlen ($ infouwz ["softname"])> 16) { Echo "."; } Echo "[". substr (str_replace ("-", "/", $ infouwz [addtime]), 0, 10). "]"; If ($ I = 1) { Echo ""; } ?>
|
|
$ I ++;} While ($ infouwz = mysql_fetch_array ($ sqluwz ));}?>
|
|
Webpage Error prompt
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource ......
------ Solution --------------------
You need to understand the do... while structure... This process repeats once, regardless of whether the conditions are true or not.
We recommend that you change it:
While ($ infouwz = mysql_fetch_array ($ sqluwz ))
{
// Do something here ....
}
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource ...... If this error is reported, add or die (mysql_error () to mysql_query ($ SQL) to check whether there is any SQL error.