Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends !!

my php code runnig nicely without any error in my local host but not running on server !!
it shows error where i use php's mysqli_numrows(),mysqli_fetchrows() etc, it showing errors like this
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/maxdudes/public_html/gujaratraksha.in/index.php on line 127

Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/maxdudes/public_html/gujaratraksha.in/index.php on line 131

Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/maxdudes/public_html/gujaratraksha.in/index.php on line 136

my code is here

<pre lang="PHP">
include_once("db_conx.php");                              
$xbt = "SELECT * from photo_upload";
$query1 = mysqli_query($con,$xbt);
$rows = mysqli_num_rows($query1); 
   
$last_date = "SELECT SrNo,Upload_Date from photo_upload WHERE SrNo='$rows'";
$query_date = mysqli_query($con,$last_date);

$last_inserted_date = mysqli_fetch_row($query_date);
echo $last_inserted_date[1];

$sql = "SELECT Img_Location from photo_upload WHERE Upload_Date = '$last_inserted_date[1]'";
$query = mysqli_query($con,$sql);
while($result = mysqli_fetch_row($query)){		
echo '<img src="'.$result[0].'" alt="" class="col-lg-12" >';
}		
Posted
Comments
EZW 1-Apr-14 15:04pm    
Change

$query_date = mysqli_query($con,$last_date);

to

$query_date = mysqli_query($con,$last_date) or die(mysql_error());

That will give you more information.
Md Jamaluddin Saiyed 2-Apr-14 10:40am    
I solved the problem with your help thank you very much sir !!!
EZW 3-Apr-14 14:08pm    
No problem, glad I could help :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900