When I use the following PHP code I get this error
Error performing query: Unknown column 'nh12134' in 'where clause'
Yet when I use 'nh12345', which is the Value that the variable $username contains (i've checked that it does by printing it out elsewhere) instead of the $username in the query it returns the correct value.
$tutorname = @mysql_query("SELECT Personal_tutor FROM Student WHERE student_ref=$username;");
if (!$tutorname) {
exit ('<p> Error performaing query: ' . mysql_error() . '</p>');
}
Any help is much appreciated
Thanks
NH