ramasaig — 2011-01-19T13:53:08-05:00 — #1
I have a database table where up to 50% of the fields in any row may be blank or NULL. The blank fields vary from row to row. The contents of the fields are strings. I want to obtain a PHP array containing the strings from a row.
I could, I suppose, create the array from all the fields and then weed out the blanks, but I wonder if there's a way in MySQL to SELECT only those fields with content. I can't name the fields in the query because I don't know in advance which row will selected and so don't know which fields won't be blank.
r937 — 2011-01-19T14:07:30-05:00 — #2
ramasaig — 2011-01-19T14:44:12-05:00 — #3
Thank you, Rudy. I've spent the minutes since I posted my thread working out how to extract the non-blank fields with PHP, and it works a treat.
r937 — 2011-01-19T15:12:04-05:00 — #4
glad to help