SpeedStreet
11-04-2003, 08:32 PM
I'm trying to create a query that will insert information into different tables at the same time, is my code right, or do I need to alter it?
Thanks!
$insertSQL = sprintf("INSERT INTO forums_user (userid, username, password, salt, options, joindate, usergroupid) VALUES (%s, %s, '" . addslashes(md5(md5($_POST['password']) . $asalt)) . "','" . addslashes($asalt) . "','0','$today','2')",
GetSQLValueString($_POST['userid'], "int"),
GetSQLValueString($_POST['username'], "text"),
("INSERT INTO forums_usertextfield (userid) VALUES ('" . addslashes($_POST['userid']) . "')"),
("INSERT INTO forums_userfield (userid) VALUES ('" . addslashes($_POST['userid']) . "')")
);
Thanks!
$insertSQL = sprintf("INSERT INTO forums_user (userid, username, password, salt, options, joindate, usergroupid) VALUES (%s, %s, '" . addslashes(md5(md5($_POST['password']) . $asalt)) . "','" . addslashes($asalt) . "','0','$today','2')",
GetSQLValueString($_POST['userid'], "int"),
GetSQLValueString($_POST['username'], "text"),
("INSERT INTO forums_usertextfield (userid) VALUES ('" . addslashes($_POST['userid']) . "')"),
("INSERT INTO forums_userfield (userid) VALUES ('" . addslashes($_POST['userid']) . "')")
);