Reading database code

Source: Internet
Author: User
Ask for a read database code
Ask for a separate page code I do not know programming do not give clues to ideas or anything
First of all, thank you very much MySQL account 132 password 456 read the library name AA table name cc column in the BB table assume that the first 500 values read the CC field value 9 character records how many 9 characters and displayed on the page if 10 pages display 10 no display 0


------Solution--------------------


@mysql_connect ("localhost", "123", "456");
@mysql_select_db ("AA");
mysql_query ("Set names UTF8");
$result =mysql_query ("Select cc from BB limit 0,500");
while ($row =mysql_fetch_array ($result)) {

}
$cnt =count ($ar);
for ($i =0; $i < $cnt; $i + +) {
if ($ar [$i]==9) {
$b []= $i;
}
}
$cnt _b=count ($b);
if ($cnt _b>0) {
echo $cnt _b;
}else{
echo 0;
}

------Solution--------------------
$result =mysql_query ("Select order_state from Order limit 500");
$counter = 0;
while ($row =mysql_fetch_array ($result)) {

}
Echo $counter;
  • 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.