Not sure I'm connecting.
Posted: Thu Dec 11, 2008 1:13 am
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
I'm having problems getting information from MySQL. Do I have an error here. I have googled about select and I can't find the error.
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
I'm having problems getting information from MySQL. Do I have an error here. I have googled about select and I can't find the error.
Code: Select all
$link2 = mysql_connect($dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$Username = $_POST['username'];
$Password = $_POST['password'];
$query = "select * from $table where 'usersname' = $username and 'password' = $password";
$result = mysql_query($query);
// Make sure you actually get a result:
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
// include "login.html";
echo "Bad login";
} else {
$_SESSION['username'] = "$username";
// include "memberspage.php";
echo "Good login";
}~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: