An error occurred while reading data.

Source: Internet
Author: User
Tags sql error
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 ){?> } Else {$ I = 1;Do {?> $ I ++;} While ($ infouwz = mysql_fetch_array ($ sqluwz ));}?>
No software is available for download!

"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 "";
}
?>






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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.