Hi
i have created a calendar from a table:
Code: Calendar: October 2009
<table width=300 border="1">
<tr>
<th><a href="calendar.php"><</a></th>
<th>M</th>
<th>T</th>
<th>W</th>
<th>T</th>
<th>F</th>
<th>S</th>
<th>S</th>
<th><a href="calendar.php?nov09">></a></th>
</tr>
<tr>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td></td>
<td>5 </td>
<td>6</td>
<td>7 </td>
<td>8 </td>
<td>9 </td>
<td>10 </td>
<td>11 </td>
</tr>
<tr>
<tr>
<td></td>
<td>12 </td>
<td>13 </td>
<td>14</td>
<td>15 </td>
<td>16 </td>
<td>17 </td>
<td>18 </td>
</tr>
<tr>
<td></td>
<td>19 </td>
<td>20 </td>
<td>21 </td>
<td>22</td>
<td>23 </td>
<td>24 </td>
<td>25 </td>
</tr>
<tr>
<td></td>
<td>26 </td>
<td>27 </td>
<td>28 </td>
<td>29 </td>
<td>30 </td>
<td>31 </td>
<td> </td>
</tr>
</table>
The table works fine.
But i have a mysql table and it has some dates in it, so for example it has 01102009 which is the 1st October 2009 and it has another date eg. 12102009 which is the 12th October 2009 etc. I want it so that the table recognises the dates and the dates are shown in blue. I was going to do this like this:
Code: $booked = mysql_query("SELECT * FROM calendar WHERE `company` = '$logged[company]'");
$booked = mysql_fetch_array($booked);
echo'
<table border="1">
<tr>
<td>M</td>
<td>T</td>
<td>W</td>
<td>T</td>
<td>F</td>
<td>S</td>
<td>S</td>
</tr>
<tr>
<td>';
if($booked[datebooked] == "01102009"){
echo"<font color='blue'>01</font>";
}
else{
echo"01";
}
echo'</td>
<td>';
if($booked[datebooked] == "02102009"){
echo"<font color="blue">02</font>";
}
else{
echo"02";
}
echo'</td>
<td>03</td>
<td>04</td>
<td>05</td>
</tr>
</table>
';
And so on, this works the first time so 01 would be blue, but 12 would be normal, i know this is something to do with it only being able to select one at a time, but i dont know how to fix it, any ideas.
I could maybe use a while loop if anyone hasnt got any better ideas???
Thanks In Advance
Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I am coding a registration form. I ask the user a Yes/No question. Depending on the answer I have an
Adding delete feature to my forum
Hello I am currently trying to add a delete feature to my forum. I believe I have everything built right but I am having some problems when debugging. I do not have PHP Designer 2008 and I am using
Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing is that I'm getting a dump after I press de button of my added function; the exception is
How to Detect it is public_html or httpdocs?
How to check whether it is cPanel or Plesk?If it found public_html perform <?php include("callcPanel.php"); ?>Else if found httpdocs perform <?php
Parse XML
Good day,I use oempro software and try to parse XMLReturn but it's not working for me, simplexml_load_string return tons of errors. Maybe someone could help me?Code:
Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now make the form Validate for empty fields when the user hits the submit button. Problem is when I added
ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patientsThe site is built off Wordpress and I'm getting the pages title using Wordpress function: Line number On/Off |
PHP If Else statement for breadcrumb
HiI am trying to use a PHP if else statement to display a breadcrumb link on wordpressThe codeLine number On/Off | Expand/Contract <div class="triple silhouette_break">
want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for upload but that is not working actually..i don't know what is the problem.when i upload a file and
add 20 000 to the rowcnt
Hi ... I need to add 20 000 to the row count but just cant find a way to do this i am new to php coding so please can u help me,the reason i need this is so i can clear the mysql database after it