How do you write data in PHP with the same fields in multiple MySQL tables?
Reply to discussion (solution)
The same fields in multiple tables are written at the same time
It's obviously not a reasonable design.
Although the relational database will have some redundancy, it's not like you
can execute multiple SQL
$username = $_post[' username ');
$password = $_post[' psd '];
$sex = $_post[' sex '];
$grade = $_post[' grade ');
$age = $_post[' age '];
$height =$_post[' height '];
$weight =$_post[' weight '];
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 ';
?>
How does this change?
Your knot rate is too low.
What is the same and what is the concept can you say more details?
I have succeeded, thank you guys, PS I am not a low knot rate, but in a period of time to write too many new posts, weighted average after .... You see the scene, so I think in fact, the forum of the knot paste method and algorithm needs to be improved