I have these line of code, when i connect to a database, I get the correct user in the $user variable but when I run everything I get an error saying:
Error performing query: Unknown column '$user' in 'where clause'
How could it not know what the variable is?
$url = $REQUEST_URI;
$pieces = explode("/", $url);
$user = $pieces[3];
echo("$user");
$result = mysql_query('SELECT * FROM Distributor WHERE Username = $user');
if (!$result) { echo('<P>Error performing query: ' . mysql_error() . '</P>'); exit();}