how might i form an IF statement to determine how many, and which, if any fields are populated in any given row of my db?
specifically-- i have 10 fields (9 + 1 primary key, auto_inc). in addition to the primary key, one of these fields has been completely populated w/ a unique identifier representing all widgets which need describing.
PURPOSE of APP:
Ensure a thorough description exists for a list of Widgets.
PROCESS OF APP (as i see it, and at its current state of development):
Select a Widget from the entire list of Widgets, and ensure that each (or at least some) of its characteristics have been defined. Described Widgets will have their respective fields populated with data.
If Widgets have not been yet described, then show form for providing their missing description.
If a description already exists, then ask if description should be shown for verification (and updated), or to go back and select another widget from the Unique Identifier field (which currently populates a dropdown for the selection process via simple WHILE loop).
If existing Widget description needs updating, then provide appropriate form.
some of the widgets have already been described along with their unique ids during the database creation process, however, most have not.
This is the extent of my current knowledge for performing the logic test:
$widgetrow = mysql_num_rows($queryresult)
if ($widgetrow == 0) { // SHOW FORM
MY IMPASS:
the php i've shown doesn't help me at all because EVERY row already exists for my query against my Widget Identifier. I need to query instead against the empty (or defined) fields which represent the Widget's 8 possible characteristics.
how do i create the IF statement / MySQL query to test for populated fields instead of populated rows? is this a normalization issue in some way?
should this not be done using an IF statement, then what choices might i have? do you have a recommended reading for me? a reference to the manual maybe-- for a function that i don't know yet?
thanks!!!