SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am running through an sql query that brings back 3 values. I want to build arrays with these that then get put through a function that creates all the necessary html for them.

    At the moment i have 3 arrays being created and the function expects 3 inputs. This is all fine except what happens if on one of the rows i get back, the value is empty.

    For example, the column names are name, description and value. description could be empty.

    When building the html, i do a num_elements type loop and then use $idx for all of the variables but if description has one less element in it then i have a problem.

    So... options:

    i) you can have an empty element in an array so that $array[5] is empty for example?
    or should i use 1 multi-dimensional array for all the data and if so can you explain how i could do that as the bit in professional php programming has not helped me much

    thanks everyone.

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    answered my open question, i can have empty values in an array. that solves that !


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •