Hi All Can anyone tell me why does this query give me '0' as an update of custname1 and NO change in 'pending field'instead of what I'm asking??? If I take off "AND status1 = 'Pending' " bit, it works. Some help will be greatly appreciated. if($_GET['custname1']){ $query = "UPDATE restHotel SET custname1 = '<b>Cancel</b>' AND status1 = 'Pending' WHERE id ='$id'"; $result = mysql_query($query)or die(mysql_error()); ?><script>document.location.href='restDisplayAll.php'</script><? Code (markup): Thanks Zed
Change your query to: $query = "UPDATE restHotel SET custname1 = '<b>Cancel</b>' WHERE id ='$id' AND status1 = 'Pending'"; PHP:
Thanks for your quick reply, but It hasn't worked, its same as before if I take off the last bit off it works fine. thanks Zed
Do you know what is this query logic? $query = "UPDATE restHotel SET custname1 = '<b>Cancel</b>' WHERE id ='$id' AND status1 = 'Pending'"; This means update resHotel table, update field custname1 to Cancel, where id is $id and status1 is Pending. Check you database table if this field: status1 = 'Pending' is true or not? It should work.
Sorry Chuck, It was my School boy mistake instead of using AND it should've been a Comma Thank you Zed