2014-07-24 20 views
-3
不工作

我的PHP文件Picture_gallery.php在本地主机上工作的php post方法!在服务器

<?php 
    include('connect-db.php'); 
    $response = array("total_records" => "", "result_returned" => ""); 
    $data = array("error_code" => "", "error_message" => ""); 
    $order = ""; 
    $sql = "Select * from ju_picture_gallery"; 
    $total_row = ""; 
    $result = ""; 
    $image_gallery = "folder_name"; 
    //$start_index =$_POST['start_index']; 
    //$per_page =$_POST['per_page']; 

    $folder_name = $_POST['folder_name']; 
    $start_index = htmlspecialchars($_POST['start_index']); 
    $per_page =htmlspecialchars($_POST['per_page']); 

    //$folder_name = htmlspecialchars($_POST['folder_name']); 


    //$start_index = print_r($_POST['start_index']); 
    //$per_page =print_r($_POST['per_page']); 
    //$folder_name = print_r($_POST['folder_name']); 

    if ($folder_name == "$folder_name") 
    { 
     $sql = "select pg_image_url from ju_picture_gallery where folder_name ='$folder_name' LIMIT $start_index,$per_page"; 
     $total_row = "SELECT * FROM ju_picture_gallery where folder_name ='$folder_name' "; 
     $image_gallery = "image_gallery"; 
     json_encode($result); 


    } 


    $result = mysqli_query($con, $sql); 
    $count = mysqli_num_rows($result); 
    $total=mysqli_num_rows(mysqli_query($con,$total_row)); 
    $response["result_returned"]=(string)$count; 
    $response["total_records"]=(string)$total; 
    $response["folder_name"] = (string)$folder_name; 
    if ($result) { 
     while ($r = mysqli_fetch_assoc($result)) { 
      $json[] = $r; 

     } 
     $row_count = mysqli_num_rows($result); 
     if ($row_count > 0) { 
      print json_encode(array_merge($data, array('pagination_info' => $response), array($image_gallery => $json))); 

     } else { 
      $data["error_code"] = "1012"; 
      $data["error_message"] = "No Content!"; 
      print json_encode(array_merge($data, array('pagination_info' => $response))); 

     } 

    } 
    mysqli_close($con); 
    ?> 

这里,如果运行本地主机文件,它要求所有上述职位的3个值values.if我在网络上运行冲水它不要求提交值显示一个空的场景。 这里是我的网站主办链接:

警告:mysqli_num_rows()预计参数1被mysqli_result,布尔在C中给出:\的Inetpub \虚拟主机\ certifytechnologies。 com \ mobileapp \ jumeirah \ picture_gallery.php on line 36

PHP警告:mysqli_num_rows()期望参数1是mysqli_result,bo奥利安在C中给出:\的Inetpub \虚拟主机\ certifytechnologies.com \一个MobileApp \朱美拉\ picture_gallery.php上线36

+0

刚打开您的托管错误报告。然后你可以看到抛出了什么错误。试试这个:'error_reporting(E_ALL);' –

+0

你在那个主机上设置了数据库吗? –

+0

我得到了和以前一样的结果..不工作..我需要检查任何cPanel设置 – user3317807

回答

0

我认为你需要在你的一些代码行改成这样

$result = mysqli_query($con, $total_row); 
$count = mysqli_num_rows($result); 


    $total=mysqli_num_rows(mysqli_query($con,$count)); 
$response["result_returned"]=(string)$count; 
$response["total_records"]=(string)$total; 
$response["folder_name"] = (string)$folder_name; 
if ($result) { 
while ($r = mysqli_fetch_assoc($result)) { 
     $json[] = $r; 

    } 
相关问题