Page 1 of 1

*SOLVED* Html Table In php

Posted: Wed Mar 03, 2004 10:08 am
by Themodem
Hi

i am having trouble with the if, else statement. i can get the if part to work but u need to make the page create a table with sql queries in it in the else part.

Heres my if else statment. is there any way of putting html in the else part?

Code: Select all

<?php
if(mysql_num_rows($query_Recordset1) < 1) {
    echo "There are no cars in this section."; 
} else { 

} ;
?>
Cheers Lee

Posted: Wed Mar 03, 2004 10:12 am
by JayBird
Just like this mate

Code: Select all

<?php 
if(mysql_num_rows($query_Recordset1) < 1) { 
    echo "There are no cars in this section."; 
} else { 
?>

//all your HTML here


<?
} ; 
?>

Posted: Wed Mar 03, 2004 10:22 am
by Themodem
Thanks mate

works like a charm. its been annoying me for ages :D

Cheers

Posted: Wed Mar 03, 2004 10:23 am
by JayBird
you can jump in and out of php as much as you like.

There are other ways of doing it. If you wanna know, just shout, but if that works for you, then stick with it :)

Mark