Two dd statements write the same circular code. is one of them not executed?

Source: Internet
Author: User
Two dd statements write the same circular code. is one of them not executed? Two dd statements write the same circular code, one of which is displayed as blank

$ Ztzs = $ dbc-> prepare ("select * from naszt where 1 = 1 and zttype = ' '"); $ ztzs-> execute ();
 
 
Fetch () {?>

"Target =" _ blank ">">

Fetch () {?>

"Target =" _ blank ">">




On the page, one dd is better than displaying any data!


Reply to discussion (solution)

 Prepare ("select * from naszt where 1 = 1 and zttype = 'weitong'"); $ ztzs-> execute ();?>
 
 
Fetch () {?>

"Target =" _ blank ">">

Fetch () {?>

"Target =" _ blank ">">



So what?

In addition, you can use the where 1 = 1 option.

When the first round of while ($ row = $ ztzs-> fetch () ends, the result set is empty (the result set pointer points to the end)
So there is no output in the second round.
You need to round the result set pointer to the beginning!
If your database class does not provide the record locating function, please write it according to the database you are using.
For example, mysql_data_seek

In addition, where 1 = 1 can be used in a way ....

When the first round of while ($ row = $ ztzs-> fetch () ends, the result set is empty (the result set pointer points to the end)
So there is no output in the second round.
You need to round the result set pointer to the beginning!
If your database class does not provide the record locating function, please write it according to the database you are using.
For example, mysql_data_seek soga. thank you.

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.