Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AlphaNumeric($length)
- {
- $chars = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_";
- $clen = strlen( $chars )-1;
- $id = '';
- for ($i = 0; $i < $length; $i++) {
- $id .= $chars[mt_rand(0,$clen)];
- }
- return ($id);
- }
- for($i=0; $i<10; $i++)
- {
- $cod = AlphaNumeric(10);
- $sql1[$i] = "INSERT INTO wm_voucere (id, cod) VALUES (NULL, '$cod')";
- $result1[$i] = mysqli_query($connection, $sql1[$i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement