php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45664 Problem with PHP executing mysql queries
Submitted: 2008-07-31 11:18 UTC Modified: 2008-07-31 22:46 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: umakantpatil4 at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.6 OS: Windowx XP
Private report: No CVE-ID: None
 [2008-07-31 11:18 UTC] umakantpatil4 at gmail dot com
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.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-31 22:46 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC