Results 1 to 4 of 4

Thread: [RESOLVED] I don't get it - SQL? Whats up with this

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2007
    Posts
    279

    Resolved [RESOLVED] I don't get it - SQL? Whats up with this

    PHP Code:
    <?
    //Database Information

    $dbhost = "";
    $dbname = "";
    $dbuser = "";
    $dbpass = "";
    //Connect to database

    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());

    session_start();
    $username = $_POST[‘username’];
    $password = md5($_POST[‘password’]);

    $query = (“SELECT * from users where username=’$username’ and password=’$password’”); - THIS IS THE Erroneous Line 

    $result = mysql_query($query);

    if (mysql_num_rows($result) != 1) {
    $error = “Bad Login”;
        include “index.htm”;

    } else {
        $_SESSION[‘username’] = “$username”;
        include “X.php”;
    }

    ?>
    Error: Unexpected T_STRING on Line 17 ( See above) I've marked it.
    Last edited by penagate; Jun 2nd, 2007 at 07:10 PM. Reason: Added [php] tags

Posting Permissions

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



Click Here to Expand Forum to Full Width