Results 1 to 4 of 4
Thread: Generate random string
Sep 30, 2007, 13:33 #1
- Join Date
- Aug 2005
- Planet Earth
- 0 Post(s)
- 0 Thread(s)
Generate random string
I'm writing a sequence of insert statements which I want to execute via the phpmyadmin interface to insert records into a table.
The table contains only two columns: name and uid. The first column is obvious. The second column is just a random string of 32 characters.
My insert statement are of the form ...
INSERT INTO user_table (name, uid) VALUES('Some Body', '3433dfdfkdsfjdfddf33dfkdfk');
INSERT INTO user_table (name, uid) VALUES('Another Body', 'ewrkdk32832wrekldfnejdsfdsf');
I want to know if there is an easier way write the insert statement so that the statement will generate the random 32 character string for me.
Such as something of the form....
INSERT INTO user_table (name, uid) VALUES('Some Body', RANDOM(32));
Or is there a way to tell phpmyadmin to populate the "uid" column of existing records with a random string if that column contains NULL.