Jump to content

PHP and SQL Syntax help


01hanstu

Recommended Posts

Hi hope you can help. In a nutshell i have a booking system where people logon, book a room and use the room simple. Now we have meeting rooms that are booked hourly whereas the classrooms a period based. What i want to know is how i can have something along the lines of

 

Normally its: Select * from rooms

and using the while command for the 5 periods

 

$i = 1;

while ($i < 6)

{

 

Now we need it to do both 6 periods but only for specific rooms. i.e.

 

if the room selected is "Triage" then

 

 

$i = 1;

while($i < 7

{ ...

___________________________________________________

 

i have tried the following:

 

If ($room=='Triage')

print"<td><div align=\"center\">".mysql_result($result,0,"mon$i");

print "<br /><br />". mysql_result($result,0,"monclass$i");

print "</div></td>";

 

 

HELP IS REALLY APPRECIATED

Stuart

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/140476-php-and-sql-syntax-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.