I've a little code snippet here:
<?php
//logic to connect to database and rest of the settings.
// ...................//
$res = mysql_query("select * from account"); //returns 1200 records
while($row = mysql_fetch_array($res)){
//some of the logical operations performed here.
if(condition){ //condition is not a variable. its result to be evaluated
updateDatabase($data1, $data2);
}else{
updateDatabase($data1, 0);
}
}
?>
<?php
function updateDatabase($data1, $data2){
//some logical operations
//updating database.
//for testing an echo statement whether success/fail
}
?>
As this code retrieves thousands of records and operations to be performed on that and database need to be update in each case. But if I'm running this php file then its stops executing after reaching around 1000 records.
I'm unable to know the reason why it doing so as I'm beginner to php.
Anybody could help me with this problem?
whileloop. Add a counter. Now, how many times have iterated?phpecho ini_get('error_log');will tell you where it is.