Hi,
I'm fairly new to mysql. I am using PHP as well.
What I have is a table of bookings for rooms. I am able to query the database. But what I want to do is look at each row in the table and see if the vaules in the row match what the user has selected. The fields in the table are:
(booking, username, roomnum, startdate, enddate, starttime, endtime)
Is there a function that I can set up a loop to go through the table row by row and compare the values.
If a row in the table matches what the user selected i want the outcome to be boolean, to say true.
I how can i form an sql query to say something like
if exists (row where values match)
echo 'booked'
Can anyone help me form this kind of query please??
I'm fairly new to mysql. I am using PHP as well.
What I have is a table of bookings for rooms. I am able to query the database. But what I want to do is look at each row in the table and see if the vaules in the row match what the user has selected. The fields in the table are:
(booking, username, roomnum, startdate, enddate, starttime, endtime)
Is there a function that I can set up a loop to go through the table row by row and compare the values.
If a row in the table matches what the user selected i want the outcome to be boolean, to say true.
I how can i form an sql query to say something like
if exists (row where values match)
echo 'booked'
Can anyone help me form this kind of query please??
Comment