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

Error with login script
I am getting an error with my login script:

Error:
Code: Warning: Cannot modify header inf

if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough

Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the

convert static html data into dynamic
hi all

i need to convert a website which has static above 2000 articles into dynamic and add

Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.
I am attempti

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

mysql_real_escape_string making variable equal nothing
i post a form and i post the variable:
Code: $var = $_POST[variable];then i echo $var its what i

Is it possible to view php source code??
Hi All

I was just wondering if it's possible to view a websites php source code?
I know

checkbox update
I am having a brain fart right now and i cant remember how to do this. if anyone could help that wou

displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folde

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