Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is "WHERE 1"

Status
Not open for further replies.

cglaves

Technical User
Jun 7, 2001
8
US
I have installed phpMyAdmin and all queries by default are
'SELECT * FROM `WHATEVER` WHERE 1"

What does the "WHERE 1" portion mean and what is it doing?

I have searched the MYSQL manual and cant find an explanation, if you know where it is please tell.

Thanks
 
I have tested and it seems that the "where 1" dont do anything, its the same as not using any where clause.
 
I daresay its "where true" - 1 being the boolean value for true.

To prove/disprove my theory, try "where 0" - "where false" I would assume.
 
Looking at the code. I looks like it is just a default value for a prepared statement. petersJazz is right... It will act as if the where clause does not exist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top