gpt4 book ai didi

php - 警告 : mysql_fetch_array(): supplied argument is not a valid MySQL Result in line 40

转载 作者:行者123 更新时间:2023-11-29 04:24:49 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select

我一直收到错误 警告:mysql_fetch_array():提供的参数不是第 40 行中的有效 MySQL 结果在我的网页上我不知道为什么..请帮助我。背景:这个脚本是将我的数据库表拉起来命名为 yname,username,password,date,comments,works,dworks works 和 dworks 是为那些尝试过的人准备的,然后他们可以判断它是否成功有效-是的,有效dworks - 不,它没有工作它应该是投票有点忘记我的问题是关于这个脚本的 40 请帮助我

<php require "br.htm" ?>
<style>
<?php require "styles.css" ?>
</style>
<?php

$host="host"; // Host name
$username="name"; // Mysql username
$password="pass"; // Mysql password
$db_name="dbname"; // Database name
$tbl_name="passes"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

// select record from mysql
$sql="SELECT * FROM $tbl_name order by id desc";
$result=mysql_query($sql);
?>
<table background='https://lh6.ggpht.com/DFABQFuYSXLBiB6qlvDPfOONOUxCiwM6_S-dHnjW82iognQToTkORsy7RVXsAz0Y23w=w705' width='50%'>
<tr>
<th align='center'>Submition By</th><th align='center'>ScreenName</th><th align='center'>Password</th><th align='center'>Does This Work?</th>
</tr>
<tr>
<th align='center'>
<hr color='lime' width='100%'/>
</th>
<th align='center'>
<hr color='lime' width='100%'/>
</th>
<th align='center'>
<hr color='lime' width='100%'/>
</th>
<th align='center'>
<hr color='gold' width='100%'/>
</th>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>

<tr>
<td background='transparent' align='left'><i><b><? echo $rows['yname']; ?> </b></i></td>
<td background='transparent' align='center'><i><b><? echo $rows['username']; ?></b></i></td>
<td background='transparent' align='right'><i><b><? echo $rows['password']; ?></b></i></td>
<td background='transparent' align='right'><i><b>&nbsp;&nbsp;&nbsp;Yes<? echo $rows['works']; ?></b></i></td>
</tr>

<?php
// close while loop
}
?>

</table>

<?php
// close connection;
mysql_close();
?>
<center>

我不想重新设置页面样式,但如果必须的话,我会..如果你发现有什么问题,请在下面发帖并告诉我它在哪一行以及如何更正它,然后我会回来让你知道它是否有效:)谢谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com