Hi there guys,
I wrote what I thought to be a very simple db call for some info:
/*this query retrieves the admin information*/
$query = "SELECT auth FROM ".$prefix."admin WHERE username = ".$_SESSION['myusername']."";
$result = mysql_query($query) or die('MySQL error: ' . mysql_error() . '<hr/>' . $query);
while ($row = mysql_fetch_assoc($result)) {
$auth = $row['auth'];
echo "auth is ".$auth;
}
which provides this error:
MySQL error: Unknown column 'schwim' in 'where clause'
SELECT auth FROM iso_admin WHERE username = schwim
There is a username of schwim in the admin table. Here's the db drop:
CREATE TABLE iso_admin (
id int(4) NOT NULL auto_increment,
username varchar(65) NOT NULL default '',
password varchar(65) NOT NULL default '',
auth varchar(65) NOT NULL default '2',
PRIMARY KEY (id),
KEY username (username)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
INSERT INTO iso_admin VALUES (1, 'schwim', 'zippitydoohdah', '1');
I'm missing my screwup and would appreciate any help 🙂
thanks,
json