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

FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

form help
this doesn't work. i want the form action to go the location.href of the submit button chosen.. how

error reporting
hey everyone

I have a production server in which I want error reporting but only on some page

Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief t

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

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