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

Edited by rajeshkr
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.