0
嘿,那爲什麼這個代碼不工作?Wordpress,mysql_data_seek,循環內外部查詢
$qry = mysql_query("SELECT performerid,pic0 FROM ".$table." ORDER BY RAND() LIMIT 6");
$start = new WP_Query('showposts=6&orderby=rand');
if ($start->have_posts()) : while($start->have_posts()) : $start->the_post();
$rows = mysql_fetch_assoc($qry);
if (!$rows)
{
mysql_data_seek($rows,0);
$rows = mysql_fetch_assoc($qry);
}
$perfs = $rows['performerid'];
$pics = $rows['pic0'];
我ahve以下錯誤:
Warning: mysql_data_seek(): supplied argument is not a valid MySQL result resource in /home/content/d/d/a/ddxxxx
mysql_data_sweeek,我試圖再次查詢第一行,這是在一個wordpress循環內 - 如果我有更多的盆比行,再次查詢行 – webmasters 2010-08-03 08:29:03