Hi,
I want to do an insert & update statement together, but for some reason I can't get it to work, it only updates, not inserts. Here is my code, if can anyone see anything wrong?
if (!$row[0] == 0) {
$sql1="INSERT INTO availability (user_id,room_code,status,start_date,end_date) ".
"VALUES ('$UserID','$Roomcode','$status','$start_new','$end_new')";
$result1=mysql_query($sql1);
$sql2="UPDATE availability SET status='$status',start_date='$start_new',end_date='$end_new'".
"WHERE user_id='$UserID' AND room_code='$Roomcode'";
$result2=mysql_query($sql2);
}
Many thanks for any help you can provide
Ben