FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
I'm getting an error and cant figure it.
Message  

Reply with quote
Post I'm getting an error and cant figure it. 
When i run this:

$sql = "SELECT * FROM $user_table WHERE 'username' = $_POST[uname] AND 'password' = $pass";

I get this error: "Unknown column 'username' in 'where clause'"
My connection and variables are all valid.
Can someone please tell me what is wrong?

View user's profile Send private message

Reply with quote
Post  
This is because you do not need to put the single quotes around the column name.  Instead, put them around the value.  The code below should work:

Code:

$sql = "SELECT * FROM $user_table WHERE username = '' . $_POST[uname] . '' AND password = '' . $pass . ''";



_________________
www.ChooseAGoodHost.com Reliable, quality hosts
Freelance Scripting - Freelance and IT Outsourcing Marketplace
CzarWeb Solutions - Custom Design, Programming, and Web Hosting
View user's profile Send private message Visit poster's website
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com