views:

79

answers:

2

I am trying to insert 10,000+ fields into my database? Is there a limit?

$sql = 'INSERT INTO `_'.$test.'` (`user`, `pass`) VALUES ' . preg_replace($test, $replace, $final_check) . ';';
mysql_query($sql) or die(mysql_error());

Every time I try to insert the data, it fails.

+1  A: 

I believe it's your query. Make sure you are importing the right data, and it shouldn't fail.
Echo the $sql to test it.

echo $sql
Homework
A: 

There is a packet size limit in the MySQL protocol. If your SQL statement exceeds that, it can't send it to the server. The limit was for a very long time 16Mb, but fairly recent versions have raised it higher.

Also, check that you are enclosing each row's worth of data in it's own parentheses.

staticsan