01hanstu Posted November 17, 2008 Share Posted November 17, 2008 Is there a way of having a script perform the following : If room is booked then print who booked it and who for i.e. Mr Jones Y7 " If Bkd = yes then [print name/Year]" else " If Bkd = no then [print picture that is linkable to the booking form]" ; Please Advise Link to comment https://forums.phpfreaks.com/topic/133078-sql-values/ Share on other sites More sharing options...
The Little Guy Posted November 17, 2008 Share Posted November 17, 2008 Something like this: // Connections to Database go here. $sql = mysql_query("SELECT * from table_name WHERE id = '23'"); $row = mysql_fetch_array($sql); if($row['Bkd'] == 'yes'){ echo $row['name'].' / '.$row['year']; }else{ echo '<a href="/someLink.php">No</a>'; } Link to comment https://forums.phpfreaks.com/topic/133078-sql-values/#findComment-692074 Share on other sites More sharing options...
01hanstu Posted November 18, 2008 Author Share Posted November 18, 2008 Thanks for your reply, my booking system actually looks better with the pictures. Once again Thanks Link to comment https://forums.phpfreaks.com/topic/133078-sql-values/#findComment-692572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.