Okay cool. I'm able to get the first file to work which reads a flatfile and puts in the partnumber and a timestamp (amongst other things) and now I'm trying to use the same method of fgets to update the database with other information where the partnumber in the database is equal to the partnumber in the second flat file and I'm getting the following error:
Fatal error: Maximum execution time of 480 seconds exceeded in C:\xampp\htdocs\ScheduledTasks\DTLRPTB_SAS-MySQL.php on line 22
line 22 is this:
if (!($upload_result = mysql_query($upload_query)))
Here's my code
<?[
require("connect.php");
$filename = "C:/xampp/htdocs/ScheduledTasks/Downloads/DTLRPTB.txt";
$connectmysql = mysql_connect($host,$user,$password) or die ($cantconnectmysqlmessage);
$db = mysql_select_db($database,$connectmysql) or die ($cantconnectdatabasemessage);
// Central Standard Time
date_default_timezone_set('America/Chicago');
$timenow = date("Y-m-d H:i:s");
// Central Standard Time
/*--- READING IN THE FILE ---*/
$file_handle = fopen($filename, "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
IF(TRIM(SUBSTR($line,0,25))<>""){$PARTNUMB = TRIM(SUBSTR($line,0,25));}ELSE{$PARTNUMB = "";}
$upload_query = "UPDATE $DetailReportATable SET TIMESTAMPB = '". $timenow ."' WHERE PARTNUMB = '$PARTNUMB'";
if (!($upload_result = mysql_query($upload_query)))
{
$mcrmessage = mysql_error();
echo "$mcrmessage<br>";
die();
}
}
fclose($file_handle);
?>
It seems to add some data to my database but doesn't finish and gives me this error....