I'm coding a registration form that includes a file upload field. Basically, there are two queries that need to be simultaneously inserted into a database. But unfortunately, I don't know how to do it. So, I need your help.
if ($my_upload->upload()) { // new name is an additional filename information, use this to rename the uploaded file
query(sprintf("INSERT INTO users SET userimage = '%s'", $my_upload->file_copy));
}
}
// end of file upload part
if (!empty($_POST["username"]))
{
$result = query("INSERT INTO users (firstname, lastname, username, usersex, hash, email) VALUES (?, ?, ?, ?, ?, ?)",
$_POST["firstname"],
$_POST["lastname"],
$_POST["username"],
$_POST["usersex"],
crypt($_POST["password"]),
$_POST["email"]);
}