I need to pass query results as attributes of divisions. The idea is to draw a different size box depending on the returned value.
I can do this with a <table> tag, but when I use versions of the same thing to pass the values to <div> tags, nix nix.
This works. A larger 'value' draws a larger box:
while([COLOR=DarkSlateBlue]$fetched[/COLOR] = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<td>[COLOR=DarkRed]<table[/COLOR]
height=\"".[COLOR=DarkSlateBlue]$fetched[/COLOR]['[COLOR=Navy]value[/COLOR]']."\"
width=\"".[COLOR=DarkSlateBlue]$fetched[/COLOR]['[COLOR=Navy]value[/COLOR]']."\"
style=\"background:#ff3333;\" [COLOR=DarkRed]>[/COLOR]</td>
</tr>[COLOR=DarkRed]</table>[/COLOR]</td>";
}
But when I try to do the same thing with <div> tags and various inline style syntax that I know to work, the concatenated $fetched values get lost. I tried a couple versions of inline style, both of which render the other attributes (absolute position, background color) except that they don't pick up the $fetched value:
while([COLOR=DarkSlateBlue]$fetched[/COLOR] = mysql_fetch_array($result, MYSQL_ASSOC)){
[COLOR=DarkRed]<div[/COLOR] style=
\"background:#ff3333;
position:absolute;
top:505px;
left:250px;
height:".[COLOR=DarkSlateBlue]$fetched[/COLOR]['[COLOR=Navy]value[/COLOR]'].";
width:".[COLOR=DarkSlateBlue][COLOR=DarkSlateBlue]$fetched[/COLOR][/COLOR]['[COLOR=Navy]value[/COLOR]']."\ [SIZE=5][B][COLOR=magenta];[/COLOR][/B][/SIZE] "[COLOR=DarkRed]>[/COLOR]
test
[COLOR=DarkRed]</div>[/COLOR]\n";
//another approach
echo "<style> .dot {
background:#ff3333;
position: absolute;
top: 355px;
left: 250px;
width:".[COLOR=DarkSlateBlue]$fetched[/COLOR]['[COLOR=Navy]value[/COLOR]'].";
height:".[COLOR=DarkSlateBlue]$fetched[/COLOR]['[COLOR=Navy]value[/COLOR]'].";
}</style>
[COLOR=DarkRed]<div[/COLOR] class=\"dot\"[COLOR=DarkRed]>[/COLOR]
test
[COLOR=DarkRed]</div>[/COLOR]\n";
}
Suggestions?