rajeshkr Posted February 22, 2014 Share Posted February 22, 2014 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 Link to comment https://forums.phpfreaks.com/topic/286407-returning-null-in-fetching-high-values-from-mysql-table/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.