Web Analytics Made Easy -
StatCounter arrays - CodingForum

Announcement

Collapse
No announcement yet.

arrays

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • arrays

    this is what I'm trying to do... (which i'm aware doesnt and shouldnt work)

    PHP Code:
    //make my array
    $days = array(

    while(
    $row mysql_fetch-array($sql)){
    //do some calcs then
       
    for($j $Start$j<= $End$j++){
         
    //put stuff in the array
            
    $j=>array(NULL,NULL'<span style="color: red; font-weight: bold; font-size: larger; text-decoration: blink;">'.$j.'</span>'),
           
       
        }
        }
     ); 
    so the question is how do I rewrite that to work?

    The sql bit basically pulls all the bookings for a given month, calculates that start and end point for that booking then the for loop goes through each day in the booking and makes that day red and flashing (just a tempory thing ) then moves on to the next booking for that month
    http://www.hazelryan.co.uk

  • #2
    If I'm understanding the problem correctly, I think this'll give you what you want.

    PHP Code:
    //initialize array
    $days = array();

    while(
    $row mysql_fetch_array($sql))
    {
      
    //do some calcs then
      
    for($j $Start$j<= $End$j++)
      {
        
    //put stuff in the array
        
    $days[$j] = array(NULL,NULL'<span style="color: red; font-weight: bold; font-size: larger; text-decoration: blink;">'.$j.'</span>'),
      }

    Comment


    • #3
      doh! I knew that... its been a long day.. Thanks!
      http://www.hazelryan.co.uk

      Comment

      Working...
      X