php logout time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aajayaprakash
    Banned
    New Member
    • Aug 2009
    • 13

    php logout time

    Code:
    <?php
    																		  if($_GET['activ_code'])
    																		  {
    	  $time_now=mktime(date('h')+5,date('i')+30);
          $a=date('h:i:s',$time_now);
    	  echo $b=date(m."/".d."/".Y);
    	  include("dbc.php");
    																		  $sql="update att_details set end_time='$a' where activation_code='{$_GET['activ_code']}' and date='$b'";
    																		  $res = mysql_query($sql) or die (mysql_error());
    
    																		  ?>
                                                     <tr>
                                                       <td width="100%" height="96" align="left" valign="top" class="label"><p align="center">&nbsp;</p>
                                                           <p align="center">
                                                             <label></label>
                                                             <label></label>
                                                           </p>
                                                         <p align="center">
                                                             <label></label>
                                                           Logout Successfully <br />
                                                           </p>
                                                         <p align="center"><a href="index.php"><u>Back</u></a></p>
                                                         </td>
                                                     </tr>
                                                     <?php
    																		  }
    																		  else
    																		  {?>
                                                     <tr>
                                                       <td height="80" align="left" valign="top" class="label"><p align="center">
                                                           <label></label>
                                                         </p>
                                                           <p align="center">
                                                             <label></label>
                                                           </p>
                                                         <p align="center">
                                                             <label></label>
                                                           Enter correct Employee Name and Employee code!<br />
                                                           </p>
                                                         <p align="center"><a href="index.php"><u>Back</u></a></p>
                                                       </td>
                                                     </tr>
                                                     <?php
    																		  }
    																		  ?>
                                                 </table></td>
    above the query i have logout time send to database
    but this is not appear my databae only 00 it coming

    any one can help me

    regards
    AJP
    Last edited by Dormilich; Sep 11 '09, 10:42 AM. Reason: Please use [code] tags when posting code
  • paulrajj
    New Member
    • Sep 2008
    • 47

    #2
    What data type you are using for end_time field ?

    Comment

    • Dheeraj Joshi
      Recognized Expert Top Contributor
      • Jul 2009
      • 1129

      #3
      Is time data type is used for your time field in data base?

      Regards
      Dheeraj Joshi

      Comment

      • aajayaprakash
        Banned
        New Member
        • Aug 2009
        • 13

        #4
        Originally posted by dheerajjoshim
        Is time data type is used for your time field in data base?

        Regards
        Dheeraj Joshi
        I am using MYSQL end_time field is time but not appear

        Reagards
        A. Jaya Prakash

        Comment

        • aajayaprakash
          Banned
          New Member
          • Aug 2009
          • 13

          #5
          Originally posted by paulrajj
          What data type you are using for end_time field ?
          Thank your reply

          I am using Mysql end_time is Timestamp but not appera pleas can u help i didnt finish that file

          Regards
          A. Jaya Prakash

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Because MySQL doesn't like the data you're giving it. Read about the timestamp data type.

            Comment

            Working...