mysql_fetch_array(): supplied argument is not a valid MySQL result resource

总是在$row=mysql_fetch_array($mql);这行有上面的那个错误,找了很长时间没有找出原因!(新手,希望各位帮帮忙!)<?phpinclude("li... 总是在$row=mysql_fetch_array($mql);这行有上面的那个错误,找了很长时间没有找出原因! (新手,希望各位帮帮忙!)
<?php
include("link2.php");

if($_POST['submit_message'])
{ $replace=str_replace(" ","",$_POST[user3]);
//$user=md5($replace);
//$password=md5($_POST[pw1].ALL_PS);

$select="select * from register where username='$replace'";
$mql=mysql_query($select);
$row=mysql_fetch_array($mql);
$array=is_array($row);
$final= $array ? $replace==$row[username] : FALSE;
if($final)
{ $sql2="insert into message(id,username,time,content)
values('','$_POST[user3]',now(),'$_POST[content]')";
$query2=mysql_query($sql2);
echo "<script language=\"javascript\">
alert('留言发表成功!');
//location.href='list.php';
</script>";
}
else
{
echo "<script language=\"javascript\">
alert('此用户名还未注册,请注册后发表留言!');
//location.href='index.html';
</script>";
}

}
?>
展开
 我来答
萬哩挑壹
推荐于2016-06-19 · 知道合伙人教育行家
萬哩挑壹
知道合伙人教育行家
采纳数:19734 获赞数:47573
校英语竞赛第一名

向TA提问 私信TA
展开全部
mysql_fetch_array(): supplied argument is not a valid MySQL result resource的意思是mysql_fetch_array():提供的参数不是一个有效的数据库资源。

例句
1 Network is the result of resource conformity with different firm.
在他们多角度的研究中,比较一致的是都强调了信息技术应用以网络形成及扩展为基本特征,是微观组织资源外向整合的结果。
2、Relayed transmission is completed by the cooperation between source and relay. As a result, resource allocation becomes an important issue in wireless cooperative diversity networks.
中继传输是由信源和中继器共同完成,因此,资源分配是无线合作分集网络研究的一个重要课题。
3、Then, on the basis of introduction of the formation conditions and development features of Longdong karst dynamic system in the Qingjiang river basin of western Hubei, China, its evolution process and characteristic result i.e. resource environmental effect, is studied.
继而以鄂西清江流域龙洞岩溶动力系统为例,在详细介绍其形成条件和发育特征的基础上,剖析其自然发展的演化过程,阐述演化结果的重要产物&特定的岩溶资源环境效应;
4 、 Can't not show the result due to resource limitation.please save the result to file instead.
因为资源的限制无法显示结果。请将结果保存在文件中。
5 、 As a result, the resource use of the system has been reduced and the continuity of data has been achieved.
节省了系统资源,同时保证了数据的连续性。
likely_01
推荐于2017-11-18 · TA获得超过148个赞
知道小有建树答主
回答量:179
采纳率:100%
帮助的人:97.8万
展开全部
<?php
include("link2.php");

if($_POST['submit_message']){
$replace = trim($_POST['user3']);
//$user=md5($replace);
//$password=md5($_POST[pw1].ALL_PS);

$select="select * from register where username='$replace'";
$mql=mysql_query($select);
$row=mysql_fetch_array($mql);
if(is_array($row)){
$sql2="insert into message(id,username,time,content) values('','{$_POST['user3']}',now(),'{$_POST['content']}')";
$query2=mysql_query($sql2);
echo "<script language=\"javascript\">
alert('留言发表成功!');
//location.href='list.php';
</script>";
}
else{
echo "<script language=\"javascript\">
alert('此用户名还未注册,请注册后发表留言!');
//location.href='index.html';
</script>";
}

}
?>
$_POST['user'];记得加上引号 你的都没有
再不行的话 就是你的数据库没有链接
追问
刚按你的程序改了!那个问题还在  数据库连接应该没问题吧!下面是连接程序:

上面的那个程序一运行就直接弹出网页消息(!此用户名还未注册,请注册后发表留言)
追答

alert('留言发表成功!');
//location.href='list.php';
";
}
else{
echo "
alert('此用户名还未注册,请注册后发表留言!');
//location.href='index.html';
";
}

}
?>不好意思 if那个判断我写错了
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式