mssql

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
kipp
Forum Commoner
Posts: 27
Joined: Fri Jan 09, 2009 1:25 pm

mssql

Post by kipp »

I am trying to perform a SELECT query and when I call for fields other than the id column I get nothing in the results. When I call the id it pulls results properly. I must be missing something....

I use the following:

SELECT * FROM adminVol WHERE u='username1'

this works though

SELECT * FROM adminVol WHERE id='1'

any thoughts?
kipp
Forum Commoner
Posts: 27
Joined: Fri Jan 09, 2009 1:25 pm

Re: mssql

Post by kipp »

Figured it out...mssql won't let you compare text values with the = operator. I found a quick fix by using the following instead:

SELECT * FROM adminVol WHERE CONVERT( VARCHAR, u )='admin'
Post Reply