Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default Bit of PHP help +rep

    Hello,

    Code:
    $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.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

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



    loool
    Last edited by Jackboy; 06-07-2008 at 12:57 PM.

  3. #3
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    That works 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.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •