I'm trying to use variables for a table and column name in a query, like:
$Table = "Products";
$Column = "Price";
$result = mysql_query("SELECT * FROM '$Table' ORDER BY '$Column'");
while($row = mysql_fetch_array($result))
It won't work, I get the ubiquitous error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in...
I am able to use variables for numerical values without any problems (don't even need to use single quotation marks), but I can't figure-out how to make it so that I can use alphabetical values in queries such as the example I posted. Could you please show me the way?