Jump to content

If field is empty


Waddy

Recommended Posts

I have a number of fields to display on a page, from a mysql query,  some fields are empty, some not. depends on what they choose on the original form.

 

I am trying to display on the form results on a page formatted using the below:

 

If the mysql field is empty, display an unchecked check box next to the result. If there is data in the field display a check box ticked.

 

What can i do to achieve this, can you point me in the right direction?

 

Results page using echo:

 

</TD><TD>Options: <input type='checkbox' CHECKED>". $row[17]. " </TD> = is not empty field
</TD><TD>Options: <input type='checkbox' UNCHECKED>". $row[17]. " </TD> = emtpy ,mysql field
</TD><TD>Options: <input type='checkbox' CHECKED>". $row[18]. " </TD> = not empty mysql field from query
</TD><TD>Options: <input type='checkbox' UNCHECKED>". $row[18]. " </TD> = Empty field in mysql

 

I am trying to show Rows 1 to 16 to display normally, rows 17 to 30 use the above logic.

 

There are about 30 fields to display like this, the others are required fields and are displayed no matter what.

Link to comment
https://forums.phpfreaks.com/topic/216316-if-field-is-empty/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.