About UNION and WHERE $ id = $ _ GET ['id']; // the value from another page hyperlink $ id = & quot; whereWebMailUserN = & quot ;. $ id; // -- traverses the data in all the tables in the array and displays the field content $ table = array (& q problems related to UNION and WHERE
$ Id = $ _ GET ['id']; // The value sent from another page hyperlink
$ Id = "where WebMailUserN =". $ id;
// -- Traverse all the table data in the array and display the field content
$ Table = array ("content_201202", "content_201203", "content_201204 ");
$ Select = array ();
Foreach ($ table as $ v ){
$ Select [] = "(select * from $ v $ id )";
}
Echo $ sqll = join ('join', $ select );
$ Sqll = mysql_query ($ sqll );
$ Num = mysql_num_rows ($ sqll); // The total number of records.
(Select * from content_201208 where WebMailUserN = $ id) UNION (select * from content_201209 where WebMailUserN = $ id) UNION (select * from content_201210 where WebMailUserN = $ id)
Warning: mysql_num_rows (): supplied argument is not a valid MySQL result resource in F: \ www_local \ G04 \ list_content.php on line 49
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource in F: \ www_local \ G04 \ list_content.php on line 53
The above code does not know the error and does not display data.
------ Solution --------------------
You need to upload the id to the next page in the url.
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.