尝试使用此代码时出现此错误。我可以在不同的数据库上使用具有不同表名的完全相同的代码,并且工作正常。
<?php
$getid = $_GET['id'];
if (!$getid)
$getid = "1";
require('scripts/connect.php');
$query = mysql_query("SELECT * FROM team WHERE id='$getid'");
$numrows = mysql_num_rows($query);
if($numrows == 1){
$row = mysql_fetch_assoc($query);
$id = $row['id'];
$firstname = $row['first_name'];
$lastname = $row['last_name'];
$position = $row['position'];
$bats = $row['bats'];
$throws = $row['throws'];
$number = $row['number'];
$picture = $row['picture'];
echo "<div id='team'>
我也遇到了同样的错误,这也适用于另一个数据库(同一服务器)。
<?php
require ("scripts/connect.php");
$query = mysql_query("SELECT * FROM team WHERE id>=1 DESC LIMIT 10");
$numrows = mysql_num_rows($query);
if($numrows > 0){
Echo "
<div class='box'>
<div class='top'>Players</div>
<div class='bottom'>";
while ($row = mysql_fetch_assoc($query)){
$id = $row['id'];
$firstname = $row['first_name'];
$number = $row['number'];
echo "<a href='$site/team.php?id=$id'>$first_name $number</a><br />";
}
echo "</div></div>";