niche Posted June 15, 2010 Share Posted June 15, 2010 This produces a green box where the color comes from a style sheet: echo '<div class="box'.$counter.'" </div>';Now I need the color to come from a mysql database so I wrote this:echo '<div style="background-color:'.$row['box'];".' class="box'.$counter.'" </div>';I get a blank screen with no error messages. I'm sure I'm connecting to the database but this line doesn't work. I'm also sure it's something simple, but I don't see it. What am I doing wrong?Thanks Link to comment Share on other sites More sharing options...
dsonesuk Posted June 15, 2010 Share Posted June 15, 2010 tryecho '<div style="background-color:'.$row['box'].'" class="box'.$counter.'"> </div>';edit missed angled bracket Link to comment Share on other sites More sharing options...
niche Posted June 15, 2010 Author Share Posted June 15, 2010 That worked. Thanks to dsonesuk.Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.