scarface83 Posted March 8, 2007 Share Posted March 8, 2007 Hi, im a bit stuck with the following code, im have made a calender that i want to tie into a sql database , and depending on the value in the database will change the background colour of that day in the calender, the problem im having is with the following $colour = "#FF0000"; // this is just to test whether the background colour changes $cal_event_opentd = "<td align=center bgcolor=#<?php echo $colour;?><b>"; but for some reason the backgroud doesnt change, can anyone tell me where im going wrong , if you need to view the full script let me know Thanks Quote Link to comment Share on other sites More sharing options...
JBS103 Posted March 8, 2007 Share Posted March 8, 2007 Two # signs and no closing > probably isn't helping. Try: $colour = "#FF0000"; // this is just to test whether the background colour changes $cal_event_opentd = "<td align=center bgcolor=<?php echo $colour;?>><b>"; Quote Link to comment Share on other sites More sharing options...
scarface83 Posted March 8, 2007 Author Share Posted March 8, 2007 Hi, Thanks for your help just tried that but for some reason it changes the background to black instead of red (#FF0000) ? any ideas ? thanks Quote Link to comment Share on other sites More sharing options...
JBS103 Posted March 8, 2007 Share Posted March 8, 2007 <?php $colour = "#FF0000"; // this is just to test whether the background colour changes $cal_event_opentd = "<td align=center bgcolor=$colour><b>"; ?> You don't need the <?php echo ?> because you already have PHP open. Quote Link to comment Share on other sites More sharing options...
scarface83 Posted March 8, 2007 Author Share Posted March 8, 2007 excellent that worked a treat thanks for that , one more question , now you have helped me to do that how would i tie it in with my sql database so that if say the 1 of march has the value "#FF0000" assigned to it in the db it would only display the 1st in red and not the rest of the calender ? thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.