我使用000webhost.com,我在那裏使用phpMyAdmin。我從MySQL運行我的PHP腳本時出現這個錯誤,如標題所示:mysql.proc的列數錯誤。預計20,找到16.表可能損壞
mysql.proc的列計數錯誤。預計20個,找到16個。
該表可能已損壞。
有沒有解決方案?謝謝。
編輯:這裏是我的代碼
<?php
$username="usrname";
$password="passwd";
$database="a1xxxxx_mydb";
$host="mysqlxx.000webhost.com";
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
if (isset($_GET["userLatitude"]) && isset($_GET["userLongitude"])) {
$userLatitude=$_GET['userLatitude'];
$userLongitude=$_GET['userLongitude'];
$result = mysql_query("SELECT locationName, (6371 * acos(cos(radians(floatval( $userLatitude))) * cos(radians(locationLatitude)) * cos(radians(locationLongitude) - radians(floatval($userLatitude))) + sin(radians(floatval($userLongitude))) * sin(radians(locationLatitude)))) AS distance
FROM Location HAVING distance < 2 ORDER BY distance LIMIT 0 ,20") or die(mysql_error());
echo $result;
// check for empty result
if (mysql_num_rows($result) > 0) {
// looping through all results
// products node
$response["Location"] = array();
while ($row = mysql_fetch_array($result)) {
// temp user array
$product = array();
$product["locationName"] = $row["locationName"];
$product["locationInfo"] = $row["locationInfo"];
$product["locationLatitude"] = $row["locationLatitude"];
$product["locationLongitude"] = $row["locationLongitude"];
$product["locationPic"] = $row["locationPic"];
$product["city"] = $row["city"];
// push single product into final response array
array_push($response["Location"], $product);
}
// success
$response["success"] = 1;
// echoing JSON response
echo json_encode($response);
} else {
// no products found
$response["success"] = 0;
$response["message"] = "No products found";
// echo no users JSON
echo json_encode($response);
}
}
else {
// required field is missing
$response["success"] = 0;
$response["message"] = "Required field(s) is missing";
// echoing JSON response
echo json_encode($response);
}
mysql_close();
?>
提供一些更多的細節將是一個良好的開端:對我來說,當我執行的後續命令工作得很好。你正在運行一個存儲過程嗎? UDF?如何顯示你想要運行的一些代碼?我們很好,但我們不是通靈,不能閱讀你的想法或遠程查看你的屏幕。 – 2013-04-23 19:23:26
哦,你是對的,我把代碼儘可能快。我只是不能連接到000webhost.com.I會發布它。謝謝:) – user2086258 2013-04-23 19:24:55
http://dba.stackexchange.com/questions/956/resolving-issue-with-mysql-proc-after-upgrading-mysql-from-5-0-to-5-1 – 2013-04-23 19:45:02