If field has value...

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!

Moderator: General Moderators

Post Reply
spliceweb
Forum Newbie
Posts: 1
Joined: Mon May 03, 2010 7:30 pm

If field has value...

Post 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.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Re: If field has value...

Post 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 !=''
Post Reply