I have a database where I use the while() command to iterate through each
row and their resultant arrays to populate a table as the while() command
is executed.
I would like to have in the database a "pointer" that says something like
$MyString, but in the PHP $MyString is given a URL of an image. So every
time during the while() command it comes across the text $MyString it
instead substitutes it for the URL instead of echoing $MyString.
I have tried putting the URL of the image in a few fields directly into the
database, whilst this method does work, it is not the solution I want as
the database fields would start becoming large to cope with the URL instead
of a short VARCHAR declaration.
Does anyone have an idea how to get the text to be substituted while the
while() command is going through an array? The array cannot be "messed"
around with, it has to stay in the order it is being read out of for
display into a table.
My current code looks like:
$Yes = '<img src="tick.png">';
while ($row = @mysql_fetch_array($result))
{
$FName = $row['FeatureName'];
$AccountType1 = $row['Coll-1'];
$AccountType2 = $row['Coll-2'];
$AccountType3 = $row['Coll-3'];
$AccountType4 = $row['Coll-4'];
$entry .= "<tr class=\"BottomLine\"><td
style=\"text-align:left;\"><B>$FName</B></td><td>$AccountType1</td>
etc.etc.
}
Thanks
Dariusz