if statement from inside print statement

A

Anonymous

Guest
Ok, just saying that the script doesn't work does not tell us anything, please post what is wrong with your script, what it does or doesn't do, errors. Oh another thing, can you please space the code out? I mean just for a soul purpose of it looking better and being easier to read, please...
I mean in PHP:
whether you write this way
o
r

t
h
i
s
w
a
y
doesn't matter to the script, but a good habbit to get in to is spacing your code out, so it will be easyer for you or anyone else to read...
ex:
hard to follow
Code:
 print '<tr><td class=normal align="center">'.$rank++.'.</td><td class=normal align="left">'.$row['CountryName'].' GP ('.$row['CircuitName'].')</td><td class=normal align="center">'.$row['Date'].'/'.$row['Month'].'/'.$row['Year'].'</td><td class=normal align="center">';
easy to follow
Code:
 print 
'<tr>
 <td class=normal align="center">'.$rank++.'.</td>
 <td class=normal align="left">'.$row['CountryName'].' GP ('.$row['CircuitName'].')</td>
 <td class=normal align="center">'.$row['Date'].'/'.$row['Month'].'/'.$row['Year'].'</td>
 <td class=normal align="center">';
 
In practice, it's best to have as little HTML code as possible in your PHP. If you find that you're uising PHP to output a lot of HTML code, then you need to look into a templating system, like patTemplate, Smarty, or SmartTemplate.
 
Back
Top