sql server - PHP/MSSQL.. Select ID based on username, insert to table based on ID? -


I've seen a lot of code and examples. This code is such a small one, but I just have

I have dbo.accounts in which ID, username, password, creative time ..

I have a simple form that You type in the username, and I need a selected query to return the ID based on the username.

  $ result = mssql_query ('dbo.account from selection id WHERE name = $ username');   

The dbo.gamemoney table will insert just some hard information such as a number of coins for the game.

My problem is that if I use a query I do id = 123, it works, but when I try to capture the id of dbo.accounts by using the username, I do not get back anything.

I know that it should be a little bit, but I have tried

Thank you for your time,

Since, the $ user name is the string type, you must add it to quotation marks.

  $ result = mssql_query ("SELECT id FROM Dbo.account WHERE name = '$ username'");    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -