wherer clause error
Posted: Sun Feb 25, 2007 3:24 pm
Hi there.
I am having a very weird problem on the easiest clause ever.
i have this table created
i have this variable in php
and this sql querry
Seems as the simplest of querries
When the querry is executed i get this error
any help would be really appreciated.
thanks
I am having a very weird problem on the easiest clause ever.
i have this table created
Code: Select all
CREATE TABLE `user_home` (
`user` varchar(20) NOT NULL default '',
`homeid` int(11) NOT NULL default '0',
PRIMARY KEY (`user`,`homeid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;Code: Select all
$username = $_GET['username'];Code: Select all
$sql = "SELECT
homeid
FROM
user_home
where user_home.user = $username";When the querry is executed i get this error
where smith is one of the username and the user that called this script.Could not query:Unknown column 'smith' in 'where clause'
any help would be really appreciated.
thanks