Jump to content

[SOLVED] Help with calender


scarface83

Recommended Posts

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

Link to comment
Share on other sites

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>"; 

Link to comment
Share on other sites

<?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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.