Jump to content

[SOLVED] MySQL INSERT Giving me an Error


Cheater912

Recommended Posts

Hi, I'm trying to enter a large about of data in a database using PHP.

I have 3 fields (id, dir, and password).

The dir and passwords are simply hashes of the id number.

The id number is going to be every number between 1000000 and 10000000.

27,000,000 strings need to be added in total.

 

I get this error while running the script:

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (id, dir, password) VALUES ('1000001', '59e711d152de7bec7304a8c2ecaf9f0f',' at line 1"

 

<?php
$number = 1000000;
mysql_connect("hidden", "hidden", "hidden") or die(mysql_error());
mysql_select_db("hidden") or die(mysql_error());

while($number < 10000000) {
$number = $number + 1;

mysql_query("INSERT INTO table (id, dir, password) VALUES ('" . $number . "', '" . md5($number) . "', '" . md5(sha1(md5($number))) . "')") or die(mysql_error());  
}
echo "Done!";
?>

 

What's wrong with the coding?

Link to comment
https://forums.phpfreaks.com/topic/122987-solved-mysql-insert-giving-me-an-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.