You might want to consider a slightly different approach - that being to
use your php code to generate a delimited file of your data and use
either mysqlimport from the command line if you can, or the LOAD DATA
INFILE sql statement to load the file into your database. That's going
to be a lot faster than running 13000 queries through your php script.

..mike..


On Wed, 2002-07-24 at 00:01, Thomas Edison Jr. wrote:
> Ok i have simple issue, i'm stuck at one point.
> 
> I have a table "Clientdetails" which contains
> ClientID.
> I have created another table "Authentication" with 2
> fields, "ClientID" and "Password".
> 
> I want to pick up the ClientID from table
> "Clientdetails" and insert "ClientID" and a Password i
> have generated using a code, into "Authentication".
> 
> So if there are 13000 ClientID's in "Clientdetails",
> as, many rows with the ClientID & it's corresponding
> password should be Inserted into table
> "Authentication".
> 
> I'm using the following code which i know is wrong,
> what would be correct?
> 
> <?
> $db = mysql_connect("localhost","user","pwd");
> mysql_select_db("myDB",$db);
> 
> $result = mysql_query("SELECT * FROM
> clientdetails",$db);
> if ($myrow = mysql_fetch_array($result)) {
> do {
> 
> $some = $myrow[clientid]
> $newid = eregi_replace('100', '', $myrow[clientid]);
> $date = date("dn");
> $stuff = $newid.def.$date;
> 
> $sql = "INSERT INTO authentication
> VALUES('$some','$stuff')";
> $result = mysql_query($sql);
> echo "All Done!";
> 
> } while ($myrow = mysql_fetch_array($result)); 
> }
> 
> ?>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to