A select Statement using "AND"

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

User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

If searching on a field that is an Int then no quotes are required.

select *
from mytable
where myintvalue = $myint

However, you can also use quotes in this query and it will work just as well

select *
from mytable
where myintvalue = '$myint'

If it is a string field type then quotes must be used

select *
from mytable
where mystringvalue = '$mystring'
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Takuma, yes, though this is postgresql.
User avatar
Love_Daddy
Forum Commoner
Posts: 61
Joined: Wed Jul 10, 2002 6:55 am
Location: South Africa
Contact:

Post by Love_Daddy »

I used sjunghare's method and it worked fine.
Post Reply