Page 1 of 1

If field has value...

Posted: Mon May 03, 2010 7:48 pm
by spliceweb
Here's what I am trying to accomplish:

I need a snipplet that checks to see if a field ("logo") within a MySQL table has a value. I then need an if statement that if the field has a value, no matter the value, then print (echo) ....

How can I go about checking the field in the database and then continue with the echo?

Thanks.

Re: If field has value...

Posted: Mon May 03, 2010 10:56 pm
by a94060
I think after executing your query, you could do something a long the lines of

Code: Select all

while($row=mysql_fetch_array($result))
For the query you could do something like

Code: Select all

SELECT * FROM TABLE WHERE logo !=''