Zadejte hledaný výraz...

Pomoc čas mysql ostává 0000-00-00 00:00:00

Johny26
verified
rating uzivatele
25. 3. 2011 09:37:16
Potreboval by som pomoc, pri prvej editácii tabuľky sa my čas v mysql neaktualizuje ostáva 0000-00-00 00:00:00
Prikladám nastavenie mysql a php.
Nastavenie mysql:
CREATE TABLE IF NOT EXISTS `amount_transfer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`pay_type` varchar(20) DEFAULT '',
`entrydate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`amount` int(11) DEFAULT '0',
`credit` int(10) DEFAULT '0',
`credit_type` varchar(10) NOT NULL DEFAULT '',
`amount_type` varchar(20) NOT NULL,
`reason` tinytext NOT NULL,
`trans_type` enum('A','P','N') NOT NULL DEFAULT 'N',
`deleted` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=685 ;
PHP kód:
$adm_functions->is_admin_login();
$listdescIcon2=$adm_functions->getActiondesc1('autobid');
if($transfer)
{
$dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason, trans_type,credit_type,amount_type) values('$user_id', '$CURRENT_Time', '$bid', 'Credit', '$reason', 'N','C','A')");
$sql2="update users set balance=balance+'$bid' where user_id='$user_id'";
$result=$dbh->query($sql2);
$user_email=$adm_functions->Get_Email($user_id);
/*$message='

Congratulation, your bid has been transferred successfully. We will get back to you very soon.


Bid Transfer : '.$bid.'';*/
//$subject=$reason;
$Email_info=$adm_functions->Email_info(24);
$subject=$Email_info;
$msgBody=$Email_info;
//$msgBody=str_replace(""", "'", $msgBody);
eval("$msgBody = "$msgBody";");
$adm_functions->Send_mail($user_email,$subject,$msgBody,$SITE_TITLE,$SITE_EMAIL);
echo '';
}
//Delete
if($del) $dbh->query("update amount_transfer set deleted='Y' where id='$del'");
$user_dd=$adm_functions->getUserList();
//pagination settings
if(!$page_no) $page_no=0;
$start=($page_no * $MAX);
$count=$start+1;
$sql="select C.*, U.username, U.mobile, U.email from amount_transfer as C left join users as U on C.user_id=U.user_id where pay_type='Credit' and C.deleted='N' and amount_type='A' order by C.id desc LIMIT $start, $MAX";
$sqlResult=$dbh->query($sql);
if($dbh->num_rows()>0)
{
$transfer_list.="
S.No.
Username
Email
Mobile
Bid
Entrydate
Reason
Action
";
while($row = $dbh->next_raw_record()){
while(list($key,$val) = each($row)) $$key = $val;
$count%2!=0?$row_color="#fa8406":$row_color="#febb2e";
$entrydate1=$adm_functions->get_date_format($entrydate);
$transfer_list.="
$count
$username
$email
$mobile
$amount
$entrydate1
$reason
";
$count++;
}
}
else
$transfer_list.="Information not available.";
////////////////////////////////////////////Pagination////////////////////////////////
$sql="select C.*, U.username, U.mobile, U.email from amount_transfer as C left join users as U on C.user_id=U.user_id where pay_type='Credit' and C.deleted='N' and amount_type='A' order by C.id desc";
$sqlResult=$dbh->query($sql);
$TOTAL_RECORDSET=$dbh->num_rows();
$i=1;
$no_of_pages = ceil($TOTAL_RECORDSET / $MAX);
if($no_of_pages>1){
$pagination="Go Page :";
}else $pagination="";
?>
Chcem aby som mal čas aktuálny aj pri prvej editácii.
Za ochotu a pomoc vopred ďakujem.
25. 3. 2011 09:37:16
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622093
Petr
verified
rating uzivatele
(9 hodnocení)
25. 3. 2011 09:41:42
vypis si pres echo tuto query
$dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason, trans_type,credit_type,amount_type) values('$user_id', '$CURRENT_Time', '$bid', 'Credit', '$reason', 'N','C','A')");
co Ti vypise??
25. 3. 2011 09:41:42
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622092
duben
verified
rating uzivatele
(49 hodnocení)
25. 3. 2011 09:49:44
Zkus nespoléhat na trigger a dej do každého Update příkazu aktualizaci pole
entrydate = $CURRENT_Time
25. 3. 2011 09:49:44
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622091
Johny26
verified
rating uzivatele
25. 3. 2011 09:52:05
Napsal NSBM;639748
vypis si pres echo tuto query
$dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason, trans_type,credit_type,amount_type) values('$user_id', '$CURRENT_Time', '$bid', 'Credit', '$reason', 'N','C','A')");
co Ti vypise??
Tabuľka sa mi 2xedituje ale čas ostane nezmenení teda 0000-00-00 00:00:00
25. 3. 2011 09:52:05
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622090
Taps
verified
rating uzivatele
(118 hodnocení)
25. 3. 2011 09:58:48
zkus
$dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason, trans_type,credit_type,amount_type) values('$user_id',NOW(), '$bid', 'Credit', '$reason', 'N','C','A')");
25. 3. 2011 09:58:48
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622089
Petr
verified
rating uzivatele
(9 hodnocení)
25. 3. 2011 09:58:56
pouzij echo debbuger...
25. 3. 2011 09:58:56
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622088
Johny26
verified
rating uzivatele
25. 3. 2011 10:05:50
Napsal Taps;639757
zkus
$dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason, trans_type,credit_type,amount_type) values('$user_id',NOW(), '$bid', 'Credit', '$reason', 'N','C','A')");
Ok tak to funguje dík Taps
25. 3. 2011 10:05:50
https://webtrh.cz/diskuse/pomoc-cas-mysql-ostava-0000-00-00-000000#reply622087
Pro odpověď se přihlašte.
Přihlásit