if's and mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

if's and mysql

Post by evilmonkey »

Hello. I'm pretty new to this whole PHP thing, so I have a question. I want to make a script that displays ONLY the 1 field from a row (SELECT field from ROW), but only if the row has a validation id of 'yes'. I have auto-incremented ids. So generally, if the field 'validation' has a value of 'no', the data will not be displayed. Can someone tell me how I can structure an 'if' for this?

Thanks.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

use "where"

SELECT * FROM table WHERE something = 'yes'
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Ok then how do I pass the id?
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

You don't need to pass id do you? if you do what for?
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Yeah, I think you're right.

I'll make the code and see. My brain picture is a little clouded right now. If I need to pass the id, the EVIL MONKEY will be back!!!

J/K

Thanks.
Post Reply