+ Reply to Thread
Results 1 to 10 of 10

Thread: 50 points for MYSQL Help

  1. #1
    btfog is offline x10 Sophmore btfog is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    118

    50 points for MYSQL Help

    First person to get fix this gets 50 points

    On a page that I'm trying I get these 2 warnings

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/****/public_html/Copy of logindemo/processes.php on line 144

    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/****/public_html/Copy of logindemo/processes.php on line 145

    Line 144 & 145 look like this

    $login_check = mysql_num_rows($sql);
    $row=mysql_fetch_assoc($sql);




    Give me Rep, and I'll give you a cookie...

    http://farm6.static.flickr.com/5176/...7698c919d8.jpg

  2. #2
    supajason's Avatar
    supajason is offline x10 Lieutenant supajason is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    England........:-)
    Posts
    288

    Re: 50 points for MYSQL Help

    you will need to show me a bit more of your code so i can help?
    supajason was here

  3. #3
    btfog is offline x10 Sophmore btfog is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    118

    Re: 50 points for MYSQL Help

    Does This Work I Put lines 144 & 145 in bold

    include '../Copy of logindemo/include/db.php';
    $username = $_POST['username'];
    $passwordbef = $_POST['password'];
    $rember = $_POST['rember'];

    if((!$username) || (!$passwordbef)){
    $alert = "<br>You didnt put all you login details in.<br />";
    include '../Copy of logindemo/index.php';
    exit();
    }

    $password = md5($passwordbef);

    $sql = mysql_query("SELECT * FROM ".DBTBLE." WHERE username='$username' AND password='$password'");
    $login_check = mysql_num_rows($sql_username AND password);
    $row=mysql_fetch_assoc($sql_);


    $session_username = $row['username'];
    $session_first_name = $row['first_name'];
    $session_last_name = $row['last_name'];
    $session_email_address = $row['email_address'];
    $session_info = $row['info'];
    $session_user_level = $row['user_level'];
    $session_password = $row['password'];

    if ($rember == "yes") {

    $cookie_name = "".CKIEUS."";
    $cookie_value = $session_username;
    $cookie_expire = time()+60*60*24*30;

    setcookie($cookie_name,$cookie_value,$cookie_expir e,"/");

    $cookie_name = "".CKIEPS."";
    $cookie_value = $session_password;
    $cookie_expire = time()+60*60*24*30;

    setcookie($cookie_name,$cookie_value,$cookie_expir e,"/");

    }
    if($login_check > 0){

    $_SESSION['first_name'] = $session_first_name;
    $_SESSION['last_name'] = $session_last_name;
    $_SESSION['email_address'] = $session_email_address;
    $_SESSION['username'] = $session_username;
    $_SESSION['info'] = $session_info;
    $_SESSION['user_level'] = $session_user_level;
    $_SESSION['password'] = $session_password;

    header("Location: main.php");

    }

    else {
    $alert = "<br>Username or Password incorrect<br />";
    include '../Copy of logindemo/index.php';
    }
    Give me Rep, and I'll give you a cookie...

    http://farm6.static.flickr.com/5176/...7698c919d8.jpg

  4. #4
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: 50 points for MYSQL Help

    Do you connect to your mysql database at all?

  5. #5
    btfog is offline x10 Sophmore btfog is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    118

    Re: 50 points for MYSQL Help

    yah i do
    Give me Rep, and I'll give you a cookie...

    http://farm6.static.flickr.com/5176/...7698c919d8.jpg

  6. #6
    Tariqul Islam's Avatar
    Tariqul Islam is offline x10 Sophmore Tariqul Islam is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Bangladesh
    Posts
    182

    Re: 50 points for MYSQL Help

    When connecting you should follow the following script:

    $sql = "SELECT * FROM " . DBTBLE . " WHERE username='" . $username . "' AND password='" . $password . "'";
    $result = mysql_query($sql);
    $login_check = mysql_num_rows($result);
    $row=mysql_fetch_assoc($result);


    I think your problem is solved.



  7. #7
    satheesh's Avatar
    satheesh is offline x10 Elder satheesh is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Tamil Nadu,India
    Posts
    883

    Re: 50 points for MYSQL Help

    $sql = mysql_query("SELECT * FROM ".DBTBLE." WHERE username='$username' AND password='$password'");
    $result = mysql_query($sql);


    First run your Query.
    I want to buy Some Scripts So Please Click This link:http://affiliate.tufat.com/index.php?id=4384
    Please rate my site:Click here




  8. #8
    btfog is offline x10 Sophmore btfog is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    118

    Re: 50 points for MYSQL Help

    satheesh got it right. thanks for your help everyone. i'm paying you now satheesh
    Give me Rep, and I'll give you a cookie...

    http://farm6.static.flickr.com/5176/...7698c919d8.jpg

  9. #9
    satheesh's Avatar
    satheesh is offline x10 Elder satheesh is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Tamil Nadu,India
    Posts
    883

    Re: 50 points for MYSQL Help

    Thanks btfog.
    I want to buy Some Scripts So Please Click This link:http://affiliate.tufat.com/index.php?id=4384
    Please rate my site:Click here




  10. #10
    Tariqul Islam's Avatar
    Tariqul Islam is offline x10 Sophmore Tariqul Islam is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    Bangladesh
    Posts
    182

    Re: 50 points for MYSQL Help

    I think at first I give you the right solution. Ok never mind.



+ Reply to Thread

Similar Threads

  1. Text link for 5 credits.
    By Derek in forum The Marketplace
    Replies: 20
    Last Post: 02-02-2008, 12:20 PM
  2. x10 points to join CTF!
    By CrownVictoriaCop in forum The Marketplace
    Replies: 14
    Last Post: 10-19-2007, 05:26 PM
  3. [Off] Need Points? (get paid up to 2,900)
    By chaganlal1 in forum The Marketplace
    Replies: 0
    Last Post: 06-01-2006, 08:00 PM
  4. [OFF] Easy Forum Points
    By James in forum The Marketplace
    Replies: 0
    Last Post: 05-08-2006, 02:48 AM
  5. x10 Million Points Homepage - Advertise for Points!
    By minievan in forum The Marketplace
    Replies: 20
    Last Post: 02-23-2006, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers