The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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