Trouble is, I tried this and it didn't work, the script is slightly long that what I actually wrote, here is the main part, (there are 3 other $sql statement, each 1 select different dates based on >= and <=)
$sql2="SELECT * FROM table WHERE (user_id='$sUserID') && (room_code='$code') && (start_date<='$start_new') && (end_date<='$end_new') && (end_date>='$start_new') && !=(start_date>'$start_new')";
If there are any results, it updates start_date with $start_new & end_date with $end_new
In table there currently is 20010910 - 20010920, and I tired to update it to 20010907 - 20010917, which runs $sql1 which updates it, but it also runs $sql2 (the code above) yet it shouldn't run, because it has
!=(start_date>'$start_new')";
and 20010910 is greater than 20010907