只是尝试显示数据库中的一条记录...但是收到错误(获取数组时)
$con=mysql_connect("localhost","root","");
mysql_select_db("school");
$iid=$_REQUEST['id2']; //mysql_fetch_array(): supplied argument is not a valid
$d=mysql_query("select * from notification where noticeid=$iid");
$data=mysql_fetch_array( $d );
这是我的显示标准...
<tr>
<td class=""><?php echo $data['noticeid'] ?></td>
<td class=""><?php echo $data['notificationtitle'] ?></td>
<td class=""><?php echo $data['notificationbody'] ?></td>
</tr>
最佳答案
尝试以下方法:noticeid ='“。$ iid。” '
$d=mysql_query("select * from notification where noticeid='".$iid."' ");
$data=mysql_fetch_array( $d );
关于php - 从数据库中检索一条记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22497724/