FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

PHP MySQL Commands Question

 


Ben
Hiya,

I am creating a php page which lets users update their information.

Is there such thing as an EXCEPT mysql operator?

I am using SELECT at the moment, but i need to select all the records in the database, except for example record with a userid of 3.

Is there any way of doing this, so maybe:

SELECT * FROM users EXCEPT where uid = '3'

or something along the lines of that.

Thanks very much
Ben
BlackSkad
There is no such thing as an EXCEPT operator, but there is a "not equal"-operator. Read the line below as:
select all from users where uid is different from 3
This will thus get all the users, except the third.

Code:
SELECT * FROM users WHERE uid <> '3'
Stubru Freak
BlackSkad wrote:
There is no such thing as an EXCEPT operator, but there is a "not equal"-operator. Read the line below as:
select all from users where uid is different from 3
This will thus get all the users, except the third.

Code:
SELECT * FROM users WHERE uid <> '3'


Alternatively you can use != instead of <>
Ben
ok ill try both of those thanks a lot Razz!

edit --
Yep that worked a treat thanks both of you!
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.