I would like to generate random strings and insert into database, the insertion should be efficient and robust. I have a generating strings function working like this:
public function getRandString(){
$string= //generats a random string
return $string;
}
db connection:
$con = mysql_connect($host, $user, $pass)
or die ( " Not able to connect to server ");
mysql_select_db($db_name);
Now I want to create a method that insert the random strings into database 1 millon rows at once with each row contains 2 column of random strings, how should I go about this?
thanks for help in advance.