PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This is my first post in this forum. Let's help the newbie out, OK?
I'm trying to modify the following code to output results only if one particular field is not empty. If the field "complete" has any text at all (is not empty) then I would like the current code to proceed as normal. However, if the "complete" field is empty, I'd like to skip to the next entry in the database in which the "complete" field is again not empty.
Can anyone help out? I'm not trained in PHP at all, but I tinker with confidence.
OK, this is great. Not only did I get an answer, but I practically understand the entire answer. Without even trying either solution, I'm sure one or the other will work. However, I would like to completely understand the difference between an empty field (i.e. == NULL) and a string with length 0. My neophyte instinct says they're the same, but obviously not or the great volka would not have made the distiction.
Volka, or anyone else, can you bear with my ignorance and help out with an explanation? The "complete" field is for text, but will sometimes be left blank. Does that make it NULL?
Thanks. You guys (and gals) that offer your expertise are awesome!
UPDATE
As I said, one of the suggested solutions worked. For the record, it was the second one using length(complete) > 0. Yippee!
charp wrote:OK, this is great. Not only did I get an answer, but I practically understand the entire answer.
...
As I said, one of the suggested solutions worked. For the record, it was the second one using length(complete) > 0. Yippee!
That's nice to hear. To often there is the feeling of answers or ideas given that simply solves a problem without learning.
For others; please note the good use of a "for the record, this worked: ..." solution given. I'm taking any chance I get to address this, as to many skips this part, and by that gives those using the search ability of the forum a hard time finding help.