php – mysql.proc的列计数错误.预计20,发现16.表可能已损坏

前端之家收集整理的这篇文章主要介绍了php – mysql.proc的列计数错误.预计20,发现16.表可能已损坏前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用000webhost.com,我正在使用PHPMyAdmin.当我运行我的 PHP脚本时,我从MysqL得到这个错误,标题如下:

Column count of MysqL.proc is wrong. Expected 20,found 16.

The table is probably corrupted.

有没有解决方案?谢谢.

编辑:这是我的代码

<?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();
?>
我也有这个错误.我通过运行来修复它
MysqL_upgrade -u root -p

另外,通过运行重新启动MysqL服务

service MysqLd restart
原文链接:https://www.f2er.com/php/132435.html

猜你在找的PHP相关文章