Click to See Complete Forum and Search --> : database


winnie99
01-10-2010, 03:33 AM
hi everyone,

I would like to extract user's records from the database based on username.
For example after the user has login using his username, he is able to see his own records.

I have tried :

rst = stmt.executeQuery("SELECT * FROM customer_table WHERE UserName='" + username + "'");

but it doesn't work...is there anything wrong somewhere?

yamaharuss
01-11-2010, 12:32 PM
doesn't work huh? Gee, sorry... but it's been a long time since I've received the old:

Server: Msg 1995, Level 1, State 1, Line 1
Doesn't Work!

NogDog
01-11-2010, 07:47 PM
Do some debugging, such as verifying that the username variable you are using in the query has the expected value. I'm not sure what application language you are using, but normally there's some way to find out the error number and/or message returned by the DBMS is the query failed due to some sort of syntax error or such.