Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mysql_query troubles

    Error message--

    Parse error: syntax error, unexpected T_VARIABLE in /membri/exampletesting/Testing/login.php on line 12

    --


    I dont know why this isnt working. The error says unexpected T_VAR on line 12 but I cant figure out the problem.


    Code--

    <?php

    $username = $_POST['username'];
    $password = $_POST['password'];

    if ($username&&$password)
    {

    $connect = mysql_connect("localhost","root","") or die("Couldnt Connect");
    mysql_select_db("my_exampletesting") or die("Couldnt Find DB");

    $query = mysql_query("SELECT * FROM users WHERE username="$username"");------- Line 12

    $numrows = mysql_num_rows($query);

    if ($numrows!=0)
    {

    }
    else {
    die("That user doesn't exist!");
    }
    }
    else {
    die("Please enter a username and a password");
    }

    ?>

    ---

    Website if it helps. Was just testing if it worked and it doesn't ---- http://exampletesting.altervista.org...ng/Testing.php

  • #2
    New to the CF scene
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

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