Mysql 用户在线购买产品时向表中插入datetime的Sql查询
SQL查询,用于在用户在线购买产品时将日期时间插入表中。 在我的项目中,我想确定用户购买在线产品时的数据和时间Mysql 用户在线购买产品时向表中插入datetime的Sql查询,mysql,Mysql,SQL查询,用于在用户在线购买产品时将日期时间插入表中。 在我的项目中,我想确定用户购买在线产品时的数据和时间 insert into prod_ordr (order_date, order_time) values (current_date(), current_time()) select c.buyer_id, p.comp_name, p.usr_address, p.city, p.state,
insert into prod_ordr (order_date, order_time) values (current_date(), current_time())
select
c.buyer_id,
p.comp_name,
p.usr_address,
p.city,
p.state,
p.pincode,
p.contact_one,
c.prod_id,
c.qty,
c.prod_barter_val
from add_to_cart c join usr_profile p
on c.buyer_id = p.usr_id
where p.usr_email ='sunny@yahoo.com';
您只需使用now()即可执行此操作,我们可以显示当前时间和日期,但每次执行查询时,我们都会更改当前日期和时间。我想在用户购买产品时确定日期和时间。我正在尝试此代码