0

我使用以下 php 脚本:

<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
$link = mysql_connect('mywebsite', 'login', 'password'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
echo 'Connected successfully';
//Until here, everything is PERFECT, the Connection is established.

//The following piece of code spits out error 500: 
mysql_select_db("rates"); 
$query = "SELECT * FROM `table1` WHERE `RateName` LIKE '%res%'"; 
if ($r=mysql_query($query, $link)) {

while ($row=mysql_fetch_array($r)) {
print "<p><h3>{$row['UtilityName']}>/h3>
{$row['RateName']}<br />
</p><hr />\n";
}
}
else {
print mysql_error($link)
}

mysql_close($link); 

 ?>
4

1 回答 1

3

改变

print mysql_error($link)

print mysql_error($link);
                        ^
于 2013-05-08T03:01:16.627 回答