FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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!
Related topics
PHP, MySQL...
ASP +PHP+MySQL Tutorials
what is your php mysql apache installer package
Need some php/mysql dlls
The Basics (php, mysql etc)
What is useful way in this php+mysql problem?
PHP/Mysql - beginner!
A very good PHP MySQL Tutorial
Setup php,mysql and others...
php, mysql and iis5
 EASY 40 frih$ IF YOU KNOW PHP+MySQL 
Php Mysql security testing
Project to join - php,mysql??
Link PHP/Mysql with Outlook Express
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-2011 Frihost, forums powered by phpBB.