Welcome Guest, Not a member yet? Register   Sign In
Repeating an image according to a value from the database
#3

[eluser]wh1tel1te[/eluser]
I don't think you can do that with pseudo-variables (template parsing). You will have to use straight PHP.

Code:
<?php
foreach($rows as $row)
{
    ?>
    <p>Username: &lt;?php echo $row['username']; ?&gt;</p>
    <p>Rating: &lt;?php
    for($i=0; $i<$row['rating']; $i++)
    {
        ?&gt;<img src="emoticon.gif" alt="" />&lt;?php
    }
    ?&gt;</p>
    &lt;?php
}
?&gt;


Messages In This Thread
Repeating an image according to a value from the database - by El Forum - 03-20-2011, 01:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB