Jump to content

Insert 5000 user in my DB !


haibec

Recommended Posts

Hi,Write a dynamic query in a loop that Itrates 1 to 5000.append the loop index to the query like 'user' + i, user random function to generate the randon password.If you need exact code let me know.Hope this helps.Good LuckHemendra Singh ShaktawatMindfire Solutionswww.mindfiresolutions.com

Link to comment
Share on other sites

Hi,Write a dynamic query in a loop that Itrates 1 to 5000.append the loop index to the query like 'user' + i, user random function to generate the randon password.If you need exact code let me know.Hope this helps.Good LuckHemendra Singh ShaktawatMindfire Solutionswww.mindfiresolutions.com
I need exact code! help me
Link to comment
Share on other sites

Guest C + PHP
<HTML><HEAD><TITLE>This is a tool adding 5000 users to an MySQL db</TITLE></HEAD><BODY><FONT FACE="Courier New" SIZE="3"><?php // code to connect to MySQL server (resulting connection to server: $con)// code to select a DB$i = 1;$p = 1234567;while ($i <= 5000) {  $p = rand(4194304, 2147483647);  $sql = "INSERT INTO user_table (uid, username, password) VALUES ('$i','user$i','$p')";  if (!mysql_query($sql, $con)) {	die ('Error: ' . mysql_error());  }  echo "1 (more) record added: user$i";  $i++;}// code to close connection?></FONT></BODY></HTML>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...