|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-31 22:46 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 21:00:01 2025 UTC |
Description: ------------ I have made PHP script which read excel file and its to MySQL database. Well script works properly everywhere.. but when are records less if the records goes above 400 or 500 then file executes half only.. above 400 or 500 no record is added.. I just want solutions for this code. that it should not stop executing code. Reproduce code: --------------- require_once 'Excel/reader.php'; $Filename="test.xls"; $reader = new Spreadsheet_Excel_Reader(); $reader->setOutputEncoding("UTF-8"); $reader->read($Filename); print "Please wait process started..<br><br>"; for ($i = 2; $i <= $reader->sheets[0]["numRows"]; $i++) { $r1=$reader->sheets[0]["cells"][$i][2]; $r2=$reader->sheets[0]["cells"][$i][3]; $r3=$reader->sheets[0]["cells"][$i][4]; $r4=$reader->sheets[0]["cells"][$i][5]; $r5=$reader->sheets[0]["cells"][$i][6]; $r6=$reader->sheets[0]["cells"][$i][7]; $r7=$reader->sheets[0]["cells"][$i][8]; $r8=$reader->sheets[0]["cells"][$i][9]; $r9=$reader->sheets[0]["cells"][$i][10]; $r10=$reader->sheets[0]["cells"][$i][11]; $r11=$reader->sheets[0]["cells"][$i][12]; $r12=$reader->sheets[0]["cells"][$i][13]; mysql_query("insert into bea_role(zone,branch,solid,name,empid,functional_role,target_policy,target_wpc_in_lacs,issued_achvt_policies,issued_achvt_wpc_in_lacs,achvt_policies,achvt_wpc) values('$r1','$r2','$r3','$r4','$r5','$r6','$r7','$r8','$r9','$r10','$r11','$r12')") or die(mysql_error()); } print "Process Completed.."; Expected result: ---------------- Expected Result is expected that it should print both lines.. like Please wait process started.. Process Completed.. and also it should process whole file Actual result: -------------- But the actual result is Please wait process started.. the ending statement doesnt come. Hlaf of the file remains unprocessed. Please provide solutions.