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));
}
?>
Thanks,
T. Edison Jr.
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php