rajeshkr Posted February 22, 2014 Share Posted February 22, 2014 (edited) Hi, I am using a code to fetch values from the database using php code in Html format. but i am facing a problem while fetching table having more than 1000 rows that giving the result "Null", but for lesser rows table this code working fine. Here is the code... <?php include("repo_db.php"); $query=mysql_query("Select * from tbl_coupons") or die(mysql_error()); if(!$query) { mysql_close(); echo json_encode("There was an error running the query: " . mysql_error()); } else if(!mysql_num_rows($query)) { mysql_close(); echo json_encode("No result return!"); } else { $header = false; $output_string = "Production Details By Customer Name"; $output_string .= "\n"; while($row = mysql_fetch_assoc($query)) { if(!$header) { $output_string .= "\n"; foreach($row as $header => $value) { $output_string .= "{$header}\n"; } $output_string .= "\n"; } $output_string .= "\n"; foreach($row as $value) { $output_string .= "{$value}\n"; } $output_string .= "\n"; } $output_string .= "\n"; } mysql_close(); // This echo for jquery echo json_encode($output_string); ?> Can anyone suggest the problem solution. Thanks Edited February 22, 2014 by rajeshkr Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.