Jump to content

Returning Null in fetching high values from mysql table.


rajeshkr

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.