Results 1 to 2 of 2

Thread: Need Help.

  1. #1
    Join Date
    Jun 2005
    Location
    USA
    Posts
    2,047
    Tokens
    0

    Latest Awards:

    Default Need Help.

    What is wrong with this code?

    PHP Code:
    <?
       ob_start
    ();
       
    $conn mysql_connect("localhost","hablaugh_staff","********");
       
    mysql_select_db(hablaugh_staff) or die(mysql_error());
       
    $logged mysql_query("SELECT * FROM dj WHERE ip = '$ip'");
       
    $logged mysql_fetch_array($logged);
       if (
    $logged[suspended] == 1) {
       die (
    "Your account has been suspended, please contact management.
               <br />
            <br />
            <a href=\"logout.php\">Logout</a>"
    );
           }
    ?>
    and it shows the error
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/hablaugh/public_html/DJPANEL/protect.php on line 6
    If you can help + rep.
    Last edited by Lysine; 15-07-2006 at 12:01 PM.
    *Image Removed*

    Thank you Brad for the sig


    Signature edited by Nick- (Forum Super Moderator): Please do not have images that exceed the limit for non VIPs (700 x 150) in your signature.

  2. #2
    Join Date
    Nov 2005
    Location
    Australia
    Posts
    1,086
    Tokens
    111

    Latest Awards:

    Default

    <?
    ob_start
    ();
    $conn = mysql_connect("localhost","hablaugh_staff","********");
    mysql_select_db(hablaugh_staff) or die(mysql_error());
    $logged = mysql_query("SELECT * FROM dj WHERE ip = '$ip'");
    $logged = mysql_fetch_array($logged);
    if (
    $logged[suspended] == 1) {
    die (
    "Your account has been suspended, please contact management.
    <br />
    <br />
    <a href=\"logout.php\">Logout</a>"
    );
    }
    ?>

    It has a extra = on line six.

    Try this

    <?
    ob_start
    ();
    $conn = mysql_connect("localhost","hablaugh_staff","********");
    mysql_select_db(hablaugh_staff) or die(mysql_error());
    $logged = mysql_query("SELECT * FROM dj WHERE ip = '$ip'");
    $logged = mysql_fetch_array($logged);
    if (
    $logged[suspended] = 1) {
    die (
    "Your account has been suspended, please contact management.
    <br />
    <br />
    <a href=\"logout.php\">Logout</a>"
    );
    }
    ?>



Posting Permissions

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