有关union与where的问题
$id=$_get['id']; //另一页面超链接传来的值
$id = where webmailusern=.$id;
//--遍历数组中的所有表中的数据,并显示字段内容
$table = array(content_201202,content_201203,content_201204);
$select = array();
foreach($table as $v) {
$select[]= (select * from $v $id);
}
echo $sqll = join('union ',$select);
$sqll = mysql_query($sqll);
$num = mysql_num_rows($sqll);//记录总条数,为了分页
$sqln = join(' union ',$select). limit $page $pagesize;
$sqln = mysql_query($sqln);
while($row = mysql_fetch_array($sqln)){.......}
(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
上面代码不知道那有错,不显示数据
------解决方案--------------------
你需要将id连在url上传至下一页