hi, i'm back again to ask few question i have a problem on my online reservation system.

here's my code


$con = mysql_connect("localhost","root","");
if (!$con)
  die('Could not connect: ' . mysql_error());

mysql_select_db("reservation", $con);

$rno = $_POST['rno'];
$in = $_POST['ADate'];
$out = $_POST['AnotherDate'];
$nor = $_POST['noofrooms'];
$rtype = $_POST['roomtype'];
$id = $_POST['cno'];

$search="Select checkout from rent where roomno='$rno'";

if($in == '$result1')
echo "Room Number already in use.";
$sql="UPDATE rent SET roomno ='$rno', checkin = '$in', checkout = '$out', noofrooms = '$nor', roomtype = '$rtype' WHERE cno='$id'";


echo "Update Successfull";

my problem is how can i determine that the roomno is already in use with this date

for example i have 1 client already stored on my database and he will be check out in 02/21/2010 at room 1, if the admin will assign roomno 1 to the other client and if the checkin is equivalent to the checkout of 1 client i want to put an error "Room Number is Already in Use" else if not it will update my database.