I'm trying to send a MySQL query string from a C# application to a PhP submission page via POST. The problem I am receiving is when I try to use the WHERE clause it hangs up at the string I'm trying to compare to.
SELECT * FROM `tblUser` WHERE `Name`='username'
The above is the query string that I build in the C# application and send to the PhP submission page via POST method. username is the name of the variable I have in the application. The application DOES send the full string as it should be (I did print statements on the PhP-side to see the string input).
When I submit the above I receive the error:
"...Check for the right SQL syntax to use near '\'username\'' at line 1"
If I change the WHERE clause to:
Then I get:
"Unknown column 'username' in 'WHERE clause'"
I am unsure where to go from here. I have the correct SQL query string but it just won't accept it. Anytime I've done a hardcoded (php-side) SELECT query, using a variable to compare to in the WHERE clause, it has always worked. But for some reason when it sends it over from my application it won't accept the query string anymore and says it's incorrect syntax.
Any help would be greatly appreciated!