Jump to content

john010117

Members
  • Posts

    492
  • Joined

  • Last visited

    Never

Posts posted by john010117

  1. Nevermind. You started the session already ($_SESSION['username'] = $username). I overlooked that before. Sorry.

     

    Solution:

    check_login.php:

    <?php
    
    session_start();
    
    mysql_connect("localhost", "root", "xxxxxxxx");
    mysql_select_db("xxxxxxxxxxxx");
    
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    $sql = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
    $result = mysql_query($sql); 
    
    if (mysql_num_rows($result) == 0) {
    
    echo "Username and password combination not found.";
    
    } else {
        while($row = mysql_fetch_array($result)) {
            $_SESSION['username'] = $row['username'];
        }
    header("members.php");
    
    }  
    
    ?>
    

  2. @ roopurt18:

    I got this error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 2' at line 8

     

    My query now looks like this:

    <?php
    $query = "DELETE
                      $privmsgs_tbl_name,
                      $privmsgs_spec_tbl_name
                 FROM
                     $privmsgs_tbl_name,
                     $privmsgs_spec_tbl_name
                 WHERE
                     $privmsgs_tbl_name.msg_id IN (" . implode(', ', $_POST['pm_delete']) . ") LIMIT " . count($_POST['pm_delete']);
    ?>
    

     

    Any ideas?

     

    @ Hypnos: I'll try it out.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.