PHP arrays into arrays need help


Posted on 16th Feb 2014 07:03 pm by admin

Hello
I am trying to highlight the days on my calendar based on the dates that i have in my database. Currently I can only get it to display the last element in the database which leads me to believe that i have an error in my arrays

Code:
Did you know?Explore Trending and Topic pages for more stories like this.
<?php
## My database
$query = mysql_query("SELECT * FROM speaking_engagements");
while($result = mysql_fetch_array($query)){
$dates = $result['date'];
$dates = explode('-',$dates);
$dates = $dates[2];
}
#$dates = explode('-',$dates);
#$dates = $dates[2];
#$numdays = count($dates);
$time = time();
$today = date('j',$time);
$days = array(
$today=>array(NULL,NULL,'<span style="color: red; font-weight: bold; font-size: larger;">'.$today.'</span>'),
$dates=>array('#'),
8=>array('#'), ## a hard coded one that works
);
$today = getdate();
$year = $today['year'];
$month = $today['mon'];
echo '<div id="calendar">';
echo generate_calendar($year, $month, $days, 3, NULL, '/weblog/archive/2004/Jan');
echo '</div>';
?>
No comments posted yet

Your Answer:

Login to answer
186 Like 34 Dislike
Previous forums Next forums
Other forums

PHP error (line 38) my website
Hello everyone, I'm new on this
and I got a web site thats got a error not showing the photos on<

Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don'

Upload Code Help
Hi everyone I need some help with a bit of code ive been working with for a while. I am completely s

PHP FTP connect doesn't work with correct login
Hi!

i am working on this test code:
Quote<?php

$ftp_ser

simplexml_load_file and rss problem
Hi,

I have a problem parsing an rss feed using simplexml_load_file - this is strange as i hav

error with opendir
when i do this

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($han

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

present value of sequence?
Hi

Please help me to find out the present value of sequence?

Thanks

Setting/Modify Headers using mail() function
I have a question about setting email headers when using mail() in a php script.

When I send

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash