可能重复:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resourcemysql_num_rows和mysql_fetch_array错误
我得到mysql_num_rows并在此代码mysql_fetch_array错误.. 警告:mysql_num_rows()提供的参数不是一个有效的MySQL结果 /localhost/more_ajax.php on line 49
Warning:mysql_fetch_array()su pplied参数不是 /localhost/more_ajax.php一个有效的MySQL结果资源上线52
<?php ?>
<style type="text/css">
</style>
<script type="text/javascript">
$(function() {
$(".more2").click(function() {
var element = $(this);
var blab = element.attr("id");
$("#morebutton").html('<img src="ajax-loader.gif" />');
$.ajax({
type: "POST",
url: "more_ajax.php",
data: "lastblab="+ blab,
cache: false,
success: function(html){
$("#load_updates").append(html);
$(".more"+blab).remove();
}
});
return false;
});
//---------------- Delete Button----------------
});
</script>
<?php
mysql_connect("localhost","yay_website", "1234");
mysql_select_db("yay_data");
if(isSet($_POST['lastblab']))
{
$lastblab = $_POST['lastblab'];
$sql_check = mysql_query("SELECT * FROM blabbing where blab_id<'$lastblab' ORDER BY blab_id DESC limit 5");
if(mysql_num_rows($sql_check));
{
while($row=mysql_fetch_array($sql_check));
{
$blab_id=$row['blab_id'];
$blab=$row['blab'];
?>
<div style="width:500px; height:50px">
<div>
<div class="con">
<span style="padding:5px;">
<?php echo $blab; ?>
</span>
</div>
</div>
<?php }
?>
<span class="more<?php echo $blab_id; ?>" id="morebutton">
<a id="<?php echo $blab_id; ?>" class="more2" title="Follow" href="#" style="color:#000">
Mooore
</a> </span>
<?php }}
?>
您是不是首先要搜索? – 2012-03-09 02:02:07
我猜..没有..... – 2012-03-09 02:04:07
搜索:http://stackoverflow.com/search?q=Warning%3A+mysql_fetch_array%28%29supplied+argument+is+not+a+valid+MySQL+result+资源 – deceze 2012-03-09 02:15:58