Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host = "localhost";
- $db_user = "";
- $db_pass = "";
- $db_name = "";
- $db_tabl = "";
- mysql_connect($db_host,$db_user,$db_pass);
- mysql_select_db($database) or die( "Unable to select database");
- $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");
- for ($i = 1; $i =< 100; $i++) {
- $this_str = "";
- $choices = array_rand($alphanum,15);
- for ($j = 0; $j < 15; $j++) { $this_str = $this_str.$alphanum[$choices[$j]]; }
- mysql_query("INSERT INTO ".$db_tabl." VALUES ('".$this_str."', FALSE)");
- }
- mysql_close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement