Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL] Problem z UPDATE
mczlowiek
post
Post #1





Grupa: Zarejestrowani
Postów: 210
Pomógł: 0
Dołączył: 26.05.2008

Ostrzeżenie: (10%)
X----


mam problem z update, chodzi mi dokladnie o to ze w momencie logowania wstawiam w tabele users date logowania

  1. <?php
  2. $dzis = date("Y-m-d H:i:s");
  3.            mysql_query("UPDATE users SET user_lastvisit=".$dzis." WHERE user_id=".$_SESSION['SESS_MEMBER_ID']."");
  4. ?>


user_lastvisit w bazie jest typu datetime, a wcześniej pobieram SESS_MEMBER_ID

dlaczego nic nie wstawia?

a tuaj część logoania:

  1. <?php
  2. .......
  3. //Check whether the query was successful or not
  4.    if($result) {
  5.        if(mysql_num_rows($result) == 1) {
  6.            //Login Successful
  7.            session_regenerate_id();
  8.            $member = mysql_fetch_assoc($result);
  9.            $_SESSION['SESS_MEMBER_ID'] = $member['user_id'];
  10.            $_SESSION['SESS_MEMBER_USERNAME'] = $member['username'];            
  11.            $_SESSION['ERRMSG_ARR_LOGIN'] = 'Zostałeś poprawnie zalogowanu do serwisu!';
  12.            session_write_close();
  13.            
  14.            $dzis = date("Y-m-d H:i:s");
  15.            mysql_query("UPDATE users SET user_lastvisit=".$dzis." WHERE user_id=".$_SESSION['SESS_MEMBER_ID']."");
  16.            
  17.            header("location: ../index.php");
  18.            exit();
  19.        }else {
  20.            //Login failed
  21.            header("location: ../index.php?id=login-failed");
  22.            exit();
  23.        }
  24. ....
  25. ?>

proszę o pomoc
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 16:05