Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

temporary soln for the earlier one BUT>>>>>&g

Links for php scripts

Moderators: macek, egami, gesf

temporary soln for the earlier one BUT>>>>>&g

Postby sansoft » Thu May 20, 2004 5:44 am

Hi,

this was developed from my side.........but does not update the next day the user comes...plz i want to let it update the outitme field the next day!!!

Any suggesstions?????????
Code: Select all


$now = time();

$anh = $date = date("Y-m-d H:i:s a",$now);

//$today=date("F j, Y, g:i a");
$sql23="select outtime from taskdatetime where user_id='$sesuserid'";
$result23=mysql_query($sql23,$conn);
$row=mysql_fetch_object($result23);

if($row->outtime=="")
{

$sql="update taskdatetime set outtime='$anh' where user_id='$sesuserid'" ;

$result=mysql_query($sql,$conn);
}
else
{
$rt="Logout has already been registered.Cannot update the field.";
}
sansoft
New php-forum User
New php-forum User
 
Posts: 44
Joined: Fri May 07, 2004 2:16 am
Location: India

Postby gesf » Thu May 20, 2004 6:05 am

First:
Choose one of those:
Code: Select all
<?php
// This
$anh = date("Y-m-d H:i:s a",$now);

// Or this
$date = date("Y-m-d H:i:s a",$now);

// And not
$anh = $date = date("Y-m-d H:i:s a",$now);
?>


Second:
What´s your outtime field type !? DATETIME/TIMESTAMP !?
You can use MySQL for that. See this: MySQL Date And Time Functions
User avatar
gesf
Moderator
Moderator
 
Posts: 1718
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

about outtime field

Postby sansoft » Thu May 20, 2004 7:42 am

Hi gesf,



oh...yes the $anh=$date was a silly mistake....please ignore!!

my outtime field is a datetime type.Please help!!
sansoft
New php-forum User
New php-forum User
 
Posts: 44
Joined: Fri May 07, 2004 2:16 am
Location: India

Re: about outtime field

Postby WiZARD » Sat May 22, 2004 7:47 am

sansoft wrote:Hi gesf,



oh...yes the $anh=$date was a silly mistake....please ignore!!

my outtime field is a datetime type.Please help!!

some where in code:
Code: Select all
$start_time = "00:00";
$end_time  = "00:05";
$curr_date  = date("H:i",$now);

if ($start_time < $curr_date < $end_time) and ($check==false)
{
$check = true;
.....
update database

}

somthing like that..... :?
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

problem solved

Postby sansoft » Sun May 23, 2004 4:02 am

hi,

the problem is solved ...using the same if statement but in a modified manner.Thank u ver much :grin:
sansoft
New php-forum User
New php-forum User
 
Posts: 44
Joined: Fri May 07, 2004 2:16 am
Location: India

problem solved

Postby sansoft » Sun May 23, 2004 4:03 am

hi,

the problem is solved ...using the same if statement but in a modified manner.Thank u ver much :grin:
sansoft
New php-forum User
New php-forum User
 
Posts: 44
Joined: Fri May 07, 2004 2:16 am
Location: India

Re: problem solved

Postby WiZARD » Mon May 24, 2004 9:57 am

sansoft wrote:hi,

the problem is solved ...using the same if statement but in a modified manner.Thank u ver much :grin:

Welcom, but what for wrote about it twise? :-o
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron