Jump to content

Search the Community

Showing results for tags 'phpfunctions'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. I have a query which is looking for events on any given month of the year. It looks as follows... $events = array();mysql_select_db($database_dbconnect, $dbconnect);$query = "SELECT calsect, title,idcalendar, DATE_FORMAT(event_date,'%Y-%m-%d') AS event_date FROM calendar WHERE event_date LIKE '$year-$month%'";$result = mysql_query($query, $dbconnect) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) {$events[$row['event_date']][] = $row;} I then have a function which calls a calendar. As the function is looping through days of the week it also checks on each day if there is any event. If there is it prints it. If not it moves on to the next day. It actually works great. I can echo the title, idcalendar and the event_date but I can not the calsect field. /* print "blank" days until the first of the current week */for($x = 0; $x < $running_day; $x++):$calendar.= '<td class="calendar-day-np"> </td>';$days_in_this_week++;endfor; /* keep going with days.... */for($list_day = 1; $list_day <= $days_in_month; $list_day++):$calendar.= '<td class="calendar-day"><div style="position:relative;height:100px;">';/* add in the day number */$calendar.= '<div class="day-number">'.$list_day.'</div>'; $event_day = sprintf('%04d-%02d-%02d', $year, $month, $list_day); /* list the events */if(isset($events[$event_day])) {foreach($events[$event_day] as $event) { //My title appears but the $event['calsect'] is not!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $calendar.='<div class="' .$event['calsect']. '">' .$event['title']. '</div>';}}else {$calendar.= str_repeat('<p> </p>',2);} If I view source on an event I get this. <div class="">Test Event</div> where class should equal $event['calsect'] (or blue in this case) .
  • 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.