you will be having vehicle id know use that for example vehicle id is v1 and the booking date is between 15-01-2013 and 31-01-2013
then in procedure
create procedure prcVehicle
(
vehicleId varchar(10),
dtBookingDate date
)
begin
declare cnt,x int;
select count(*) from tablename where fieldname=vehicleId and fieldname for date >15-01-2013 and fieldname for date <31-01-2013
if cnt>0
set x=0;
select x;
else
your insert statement
set x=1;
select x;
end if;
end
then in front end if $res['x']=0 then already booked else can book