Check form data
if (!preg_match ('/^[\w\x80-\xff]{3,15}$/', $username)) {
Exit (' ERROR: User name does not meet requirements!back ');
}
if (strlen ($password) < 6) {
Exit (' ERROR: Password length does not meet requirements!back ');
}
Include (' conn.php ');
$sql = "INSERT into user (username,password,sex,grade,age,height,weight) VALUES (' $username ', ' $password ', ' $sex ', ' $ Grade ', ' $age ', ' $height ', ' $weight ');
INSERT into Module1 (username) VALUES (' $username ');
INSERT into Module2 (username) VALUES (' $username ');
INSERT into Module3 (username) VALUES (' $username ');
INSERT into Module4 (username) VALUES (' $username ');
INSERT into Module5 (username) VALUES (' $username ');
if (mysql_query ($sql, $conn))
Exit (' Register successfully! Click here to log in ');
Else
Echo ' Sorry, registration Error!: ', mysql_error (), '
';
Echo ' Click here to return to retry ';
?>
------Solution--------------------
Oh, I just noticed you.
$sql. = ' INSERT into Module1 (username) VALUES (' $username '); '
$sql. = ' INSERT into Module2 (username) VALUES (' $username '); '
$sql. = ' INSERT into Module3 (username) VALUES (' $username '); '
$sql. = ' INSERT into module4 (username) VALUES (' $username '); '
$sql. = ' INSERT into module5 (username) VALUES (' $username '); '
Then use Mysqli::multi_query () to support multi-statement execution MySQL can only be a single statement execution, so you plug 5 times to perform 5 times mysql_query
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.