我使用以下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);
?>
答案 0 :(得分:3)
更改
print mysql_error($link)
到
print mysql_error($link);
^