警告:mysql_fetch_assoc()期望参数1为resource,null给定 [英] Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given

查看:112
本文介绍了警告:mysql_fetch_assoc()期望参数1为resource,null给定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <   php  >  
include(connectivity.php);
mysql_select_db('world_portal');
$ sql = mysql_query(SELECT * FROM rmsignup);

? >
< html >
< head >
< title > 区域经理表< / title >
< link rel = stylesheet href = css / style1.css type = text / css / >
< / head >
< body bgcolor = #E6E6FA >
< center >


< border = 1 >
< tr >

< th > 名字< / th >
< th > 姓氏< / th >
< ; th > 移动< / th >
< ; th > 电子邮件ID < / th >
< < span class =code-leadattribute> th
> 密码< / th >
< < span class =code-leadattribute> table > < tbody > < tr >

while($ row = mysql_fetch_assoc($ sql)){
echo < 表格 > < tbody > < tr > ;
echo< td > \".$row['firstname'].\"< / td > ;
echo< td > \".$row['lastname'].\"< / td > ;
echo< td > \".$row['mobile'].\"< / td > ;
echo< td > \".$row['email'].\"< / td > ;
echo< td > \".$row['password'].\"< / td > ;
echo< / tr > < / tbody > < / table > ;
}
?& gt;
< / tr > < / tbody > < / table > < / tr > < / table >
< / center >
< / body >
< / html > < / php >

解决方案

sql = mysql_query(SELECT * FROM rmsignup);

? >
< html >
< head >
< title > 区域经理表< / title >
< link rel = stylesheet href = css / style1.css type = text / css / >
< / head >
< body bgcolor = #E6E6FA >
< center >


< border = 1 >
< tr >

< th > 名字< / th >
< th > 姓氏< / th >
< ; th > 移动< / th >
< ; th > 电子邮件ID < / th >
< < span class =code-leadattribute> th
> 密码< / th >
< < span class =code-leadattribute> table > < tbody > < tr >

while(


row = mysql_fetch_assoc(


sql)){
echo< > < tbody > < tr > ;
echo< td > < /跨度>

<php>
include ("connectivity.php");
mysql_select_db('world_portal');
$sql = mysql_query("SELECT * FROM rmsignup"); 

? >
<html>
<head>
<title>Regional Manager Sheet</title>
 <link rel="stylesheet" href="css/style1.css"  type="text/css" />
</head>
<body bgcolor="#E6E6FA">
<center>


<table border="1">
<tr>

<th>First Name</th>
<th>Last Name</th>
<th>Mobile</th>
<th>Email ID</th>
<th>Password</th>
<table><tbody><tr>

while($row=mysql_fetch_assoc($sql)){
echo"<table><tbody><tr>";
echo"<td>".$row['firstname']."</td>";
echo"<td>".$row['lastname']."</td>";
echo"<td>".$row['mobile']."</td>";
echo"<td>".$row['email']."</td>";
echo"<td>".$row['password']."</td>";
echo"</tr></tbody></table>";
}
?&gt;
</tr></tbody></table></tr></table>
</center>
</body>
</html></php>

解决方案

sql = mysql_query("SELECT * FROM rmsignup"); ? > <html> <head> <title>Regional Manager Sheet</title> <link rel="stylesheet" href="css/style1.css" type="text/css" /> </head> <body bgcolor="#E6E6FA"> <center> <table border="1"> <tr> <th>First Name</th> <th>Last Name</th> <th>Mobile</th> <th>Email ID</th> <th>Password</th> <table><tbody><tr> while(


row=mysql_fetch_assoc(


sql)){ echo"<table><tbody><tr>"; echo"<td>".


这篇关于警告:mysql_fetch_assoc()期望参数1为resource,null给定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆