...through database result set. (PHP/My? Dear Friends,
I execute the following scripts, it took almost 10 minutes and 10MB Memory to display the contents. I would like to solve this problem without using too much memory and long delay. 'SELECT * from employees_salary WHERE emid=1' will return 6015 records. Please help me to solve this problem. How to optimize the following script.
$link=mysql_connect('localhost','root','');
if(!$link){
die("Not connected".mysql_error());
}
$db=mysql_select_db('auto3',$link);
if(!$db) {
die("DB Does not Exits".mysql_error());
}
$sql = 'SELECT * from employees_salary WHERE emid=1';
$result = mysql_query($sql);
while ($row=mysql_fetch_row($result)) {
echo '<pre>';
print_r($row);
echo '</pre>';
}
}
Thanks in advance,
Vijay