Re: I'm stuck!
| From: | Szii | Date: | Mon, 15 Oct 2001 22:04:46 +0000 |
| Subject: | Re: I'm stuck! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13340@lists.php.net to get a copy of this message | ||
Check your "$password_in_db" query. Looks like you're checking the
password against the username field.
Won't fix your current problem, but it's worth fixing anyways.
-Szii
----- Original Message -----
From: "George Lioumis" <glioumis@adacom.com>
To: <php-db@lists.php.net>
Sent: Monday, October 15, 2001 4:35 AM
Subject: [PHP-DB] I'm stuck!
<?php
include ('dbconnect.php');
if ($submit== "Login")
{
$username_in_db = mysql_query("select username from guestbook where
username='$username'") or die (mysql_error());
$password_in_db = mysql_query("select password from guestbook where
username='$password'") or die (mysql_error());
}
$get_guest_id_query = "select guest_id from guestbook where
username='$username' and password='password'";
$result = mysql_query($get_guest_id_query) or die (mysql_error());
echo $result;
echo "<BR><BR>";
if ($result)
{
($guest_id) = mysql_fetch_array($result);
$guest_id = $result;
echo $guest_id;
echo "<BR>Inside if<BR>";
$update_query = "UPDATE guestbook SET last_access='NOW()' WHERE
guest_id='$guest_id'"; <-----This thing refuses to play!
$result = mysql_query($update_query) or die(mysql_error());
}
?>
.....
Can anyone, please, tell me why the above code doesn't do the update in the
DB (mySQL)???