Log in

View Full Version : Bit of PHP help +rep



iUnknown
06-07-2008, 12:46 PM
Hello,


$current = mysql_query("SELECT * FROM staff WHERE username=" . $user . "") or die(mysql_error());
$currentarray = mysql_fetch_array($current);

The error is: Unknown column 'Admin' in 'where clause'

Admin is the $user.

It's driving me mad and it's probably a small simple thing... what have I done wrong?

Thanks.

Jackboy
06-07-2008, 12:56 PM
$current = mysql_query("SELECT * FROM staff WHERE username='$user') or die(mysql_error());
$currentarray = mysql_fetch_array($current);



loool

iUnknown
06-07-2008, 12:59 PM
That works :D if I make it:

$current = mysql_query("SELECT * FROM staff WHERE username='$user') or die(mysql_error());
$currentarray = mysql_fetch_array($current);

You just forgot the last "

That's really weird though, I'm sure I tried that. Anyway, thanks for your help. +rep.

Want to hide these adverts? Register an account for free!