[thelist] php/mysql/html

Roger Harness magic32 at jps.net
Mon Aug 4 13:52:25 CDT 2003


'Volters. I have a two-parter, but I'm just going to ask the first part
first.

I'm a beginning PHP'er, so hopefully I'm just sort of dense on this one.

I have a simple database, with movies, categories, actors, and personal
ratings (1-4 stars).

I have a simple while loop that is supposed to go something like this:

<tr>
<td>$title</td>
<td>$category</td>
<td>$actor_1</td>
<td>$actor_2</td>
<td><img src='images/$rating_star.gif'></td>
</tr>

That last variable is $rating, (and I'm tring to concatenate the _star.gif).
For now, $rating with contain either "1", "2", "3", or "4".

So if i did it correctly, I'd have an <a href='images/1_star.gif'> html tag.
This *almost* works. But it won't. My output is <img src='images/.gif'>

Now I *can* mess around with the $rating data and have it contain 1_star.gif
and use <img src='images/$rating'> and THAT will work fine.

But for what i'm doing, i'd really like to just have 1, 2, 3, 4 and
concatenate (?) the _star.gif to the end. I've tried every combo of single
quotes, double quotes, excaped quotes, etc etc, and i either just get <img
src='images/_star.gif'> (or something similiar) or just get parsing errors.

This *should* be do-able, right? Any Suggestions/tips/advice?? Does this
even make sense??

as always, tia!

-Roger Harness



More information about the thelist mailing list