Two DD write the same loop code, one of which is not executed, is it?

Source: Internet
Author: User
Two DD write the same loop code, one of which is not executed?
Two DD write the same loop code, where one dd is displayed as blank


$ztzs = $dbc->prepare ("select * from Naszt where 1=1 and Zttype= ' Qnap");
$ztzs->execute ();



Fetch ()) {?>

"target=" _blank ">
">







Fetch ()) {?>

"target=" _blank ">
">














On the page when one DD is more than displaying any data!

Share to: more


------Solution--------------------
When the first round while ($row = $ztzs->fetch ()) ends, the result set is empty (the result set pointer points to the end)
So the second round has no output
You need to wrap the result set pointer to the start!
If your database class does not provide a record positioning feature, write it yourself according to the database you are using.
Like Mysql_data_seek.
  • Related Article

    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.