I want to update multiple rows
this my html code :
<form action="" method="POST">
<input type="text" name="name" placeholder=""/>
<input type="text" name="phone" placeholder=""/>
<input type="text" name="blood" placeholder=""/>
<input type="text" name="id" placeholder=""/>
<input type="text" name="email" placeholder=""/>
<input type="submit" name="sub" value=""/>
</form>
and this my php code :
if(isset($_POST['sub'])) {
$name = $_POST['name'];
$phone = $_POST['phone'];
$blood = $_POST['blood'];
$id = $_POST['id'];
$email = $_POST['email'];
if($name or $phone or $blood or $id or $email) {
$res_11 = mysql_query("UPDATE `general_info` SET `name`='$name',`phone`='$phone',`blood`='$blood',`id_2`='$id',`email`='$email' WHERE `id`='1'") or die(mysql_error());
}
}else{
echo "ERROR";
}
i have table like this
name | phone | blood
and i want if some body update just one row update
if write just new phone update just phone in database
mysql_*functions