試圖實現facebook風格分頁,我一直在收到此錯誤? Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
,警告:mysql_num_rows():提供的參數不是有效的MySQL結果資源
我不完全確定這是什麼意思,但我找不到它從谷歌搜索修復,什麼愚蠢的錯誤突出?下面的代碼:
<?php
include('functions.php');
if(isset($_POST['lastmsg']) &&is_numeric($_POST['lastmsg']))
{
$lastmsg=$_POST['lastmsg'];
$query = mysql_query("SELECT * FROM links WHERE id>'$lastmsg' ORDER BY id ASC LIMIT 9 ");
while($result = mysql_fetch_array($query))
{
$msg_id=$result['id'];
$message=$result['link'];
?>
<li> <?php echo $message; ?> </li>
<?php
}
?>
<?php
if(mysql_num_rows($result)==9){
?>
<div class="facebook_style" id="facebook_style">
<a id="<?php echo $message; ?>" href="#" class="load_more" >
Show Older Posts <img src="arrow1.png" /></a> </div>
<?php
}else {
echo ' <div id="facebook_style">
<a id="end" href="#" class="load_more" >No More Posts</a>
</div>';
}
}
?>
的可能重複的[mysql_fetch_assoc():提供的參數不是在PHP一個有效的MySQL結果資源(http://stackoverflow.com/questions/1858304/mysql-fetch-assoc-supplied-argument-is -not -a-valid-mysql-result-resource-in-ph) –