Re: [PHP-DB] I'm stuck! From: Szii (szii <email protected>)
Date: 10/15/01

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 <email protected>>
To: <php-db <email protected>>
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)???

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>