sql query

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
lipun4u
Forum Commoner
Posts: 82
Joined: Wed Jul 01, 2009 3:35 am
Location: Mumbai
Contact:

sql query

Post by lipun4u »

Just look at the query

Code: Select all

select user,password from users 
        where user='". mysql_real_escape_string($user)."' 
        and password='". mysql_real_escape_string($pw)."' 
        limit 1';
 

What does 'limit 1' means ??
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: sql query

Post by Griven »

That means that the maximum number of records it can return is 1.

LIMIT 2 will return a maximum of 2 records, and so on.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: sql query

Post by jackpf »

:google:
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: sql query

Post by Griven »

jackpf wrote::google:
Yeah, that too. It probably would have been faster.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: sql query

Post by jackpf »

yeah lol

If there was a "read the manual" smiley, I would have posted that too :P
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: sql query

Post by jackpf »

Image
Best I could find.
lipun4u
Forum Commoner
Posts: 82
Joined: Wed Jul 01, 2009 3:35 am
Location: Mumbai
Contact:

Re: sql query

Post by lipun4u »

A 9 year old kid knows google is everyone's friend. But I asked here because I have some problem with google....
Last edited by lipun4u on Sat Oct 03, 2009 4:39 am, edited 1 time in total.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: sql query

Post by jackpf »

...you have a problem with google?

...right.
Griven
Forum Contributor
Posts: 165
Joined: Sat May 09, 2009 8:23 pm

Re: sql query

Post by Griven »

jackpf wrote:...you have a problem with google?

...right.
Hey, Google can be an @sshole--especially if he's been hitting the bottle. I've had some really bad problems with him in the past. I even had to disappear for a while at the BSBS (Bing Shelter for Battered Searchers).
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: sql query

Post by jackpf »

lol
Post Reply