doucitao2944 2014-04-24 18:56
浏览 48
已采纳

花时间使用PHP / mySQL和wordpress插件

I got a little problem over here. It's about wordpress plugin but support will probably answer me in 1-2days. Maybe someone over here know the answer.

I am using myCRED plugin. It gives mi permission to give some user points on my website. So when I am giving someone points via wordpress panel then in mySQL table there is a column "time". Could someone figure this out?

Date -> php code entry in "time" column
April 24, 2014 4:28 pm -> 1398356897
April 24, 2014 3:27 pm -> 1398284766
April 23, 2014 4:30 pm -> 1398270617

I want to make php script which will add record to this table but I don't know how to fill "time" column corectly. Anyone here know function for this?

That's what I tried //you shouldn't really care about other variables. Just about the last one column called "time".

$time = time();

mysql_query("INSERT INTO wp_myCRED_log (user_id, creds, entry, time)
VALUES (".$_POST['user_id'].", '-".$_POST['price']."', 'Bought:".$_POST['reward']."', '".$time."' ; )");

If you still don't know what I mean just ask :)

Regreds, Guy with a problem.

  • 写回答

2条回答 默认 最新

  • duansai1314 2014-04-24 19:01
    关注

    This is Unix timestamp representing the date.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序