Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
890 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
$hobby = implode(',',$_POST['hobby']);
$sql = mysqli_query($conn,"INSERT INTO record(firstname,lastname,birthdate,age,phone_number,email,password,gender,hobby,picture,address)VALUES('".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['birthdate']."','".$_POST['age']."','".$_POST['phone']."','".$_POST['email']."','".$_POST['password']."','".$_POST['gender']."','".$hobby."','".$image."','".$_POST['address']."')");
if ($record = mysqli_query($conn,$sqlquery)) {
while ($recordresult = mysqli_fetch_assoc($record)) {
$hobbyname = explode(',',$recordresult['hobby']);
foreach ($hobbyname as $hobby) {
$insert = mysqli_query($conn,"INSERT INTO hobbyname(hname)VALUES('".$hobby."')");
}
}
first table name is : record
second table name is : hobbyname which i have to insert with same id