is there a limit in uplaoding a .csv file in mysql??

Codes here !

Moderators: macek, egami, gesf

mageamida
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Dec 13, 2012 11:21 pm

is there a limit in uplaoding a .csv file in mysql??

Postby mageamida » Thu Dec 13, 2012 11:33 pm

Hello to everyone,

Please help, my problem is about how to insert the other column of my .csv file to my database (MySql), I can only insert certain number of columns, 77 to be exact but if i try to add more columns it cant be inserted in the database and I already replace the datatypes of my dbase, still no luck. Thanks in advance...

mageamida
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Dec 13, 2012 11:21 pm

Re: is there a limit in uplaoding a .csv file in mysql??

Postby mageamida » Sat Dec 15, 2012 3:00 am

this is the structure of my code, hope somebody here can help me.....


<?php error_reporting(0);
$conn = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("iplus",$conn);

if ($_FILES[file][size] > 0) {

$file = $_FILES[file][tmp_name];
$handle = fopen($file,"r");
do {
if ($data[0]) {

mysql_query ("INSERT INTO createdfault
( total number of columns are 197 )
VALUES
( '".addslashes($data[0])."', ) and so on..
");
}
} while ($data = fgetcsv($handle,10000, ",","'"));

header('Location: admin.php?success=1'); die;

?>



the problem is I cant insert all the data in the .csv file. I can only insert the data up to the 78th columns and when i try to complete all of the columns the loop stop. tnx

jp26198926
New php-forum User
New php-forum User
Posts: 5
Joined: Mon Apr 30, 2012 5:48 am

Re: is there a limit in uplaoding a .csv file in mysql??

Postby jp26198926 » Thu Dec 20, 2012 7:42 pm

try to modify the value of your php.ini

max_execution_time = 10800 //10800 seconds


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest