Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. $db_host = "localhost";
  3. $db_user = "";
  4. $db_pass = "";
  5. $db_name = "";
  6. $db_tabl = "";
  7.  
  8. mysql_connect($db_host,$db_user,$db_pass);
  9. mysql_select_db($database) or die( "Unable to select database");
  10.  
  11. $alphanum = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9");
  12.  
  13. for ($i = 1; $i =< 100; $i++) {
  14. $this_str = "";
  15. $choices = array_rand($alphanum,15);
  16. for ($j = 0; $j < 15; $j++) { $this_str = $this_str.$alphanum[$choices[$j]]; }
  17. mysql_query("INSERT INTO ".$db_tabl." VALUES ('".$this_str."')");
  18. }
  19.  
  20. mysql_close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement