So let start off the new year with another simple mysql problem. I am adding data into 2 tables of the same
database, but I am having problems with the userID. How do I get the userIDs to be equal to each other during
the initial insertion of data into two tables? One of the userID in js_login is auto incremented, the other userID in
js_account is not. Here is the code:
Code: Select all
....
mysql_query("INSERT INTO js_login( username, password, FName, MName, LName, Email, survey) VALUES ( '$username', '$password',
'$FName', '$MName', '$LName', '$Email', '$survey') ") or die(mysql_error());
$query = "SELECT userID FROM js_login";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$userID;
}
mysql_query("INSERT INTO js_account(userID, FName, MName, LName, Email, Address, Suite, City, State, Zipcode,
Country, Hphone_1, Hphone_2, Hphone_3, Mphone_1, Mphone_2, Mphone_3, Wphone_1, Wphone_2, Wphone_3, Extension, acc_stat)
VALUES ('$userID', '$FName', '$MName', '$LName', '$Email', '$Address', '$Suite', '$City', '$State', '$Zipcode',
'$Country', '$Hphone_1', '$Hphone_2', '$Hphone_3', '$Mphone_1', '$Mphone_2', '$Mphone_3', '$Wphone_1',
'$Wphone_2', '$Wphone_3', '$Extension', '$acc_stat') ") or die(mysql_error());
....Any takers? Thanks in advance!
Bator