显示时间如下200712120701

时间年月日小时分钟的数字

<?php
$updatetime = time();
echo strftime("%Y%m%d%H%M",$updatetime)
?> 

一段代码

<?php
//第一步:初始化种子
//microtime(); 是个数组
$seedstr =split(" ",microtime(),5);
$seed =$seedstr[0]*10000;

//第二步:使用种子初始化随机数发生器
srand($seed);

//第三步:生成指定范围内的随机数
$random =rand(1000,10000);

?>

<?php
$article= $_REQUEST['key'];
print_r($article);
$updatetime = time();
$orderid=strftime("%Y%m%d%H%M",$updatetime).$random;
mysql_select_db($database_lr, $lr);

foreach ($article as $value){
$sql = "INSERT INTO `order_product` (orderid,articleid) VALUES ('$orderid','$value');";
$result = mysql_query($sql);}
?>

刚开始一直添加不了正确的数据,后来改数据类型为varchar添加成功。

相关文章:

  • 2022-12-23
  • 2022-01-04
  • 2021-06-22
  • 2021-09-19
  • 2021-05-16
  • 2021-09-03
  • 2021-11-02
  • 2021-10-29
猜你喜欢
  • 2021-11-25
  • 2021-10-25
  • 2022-01-24
  • 2021-08-10
  • 2021-08-29
  • 2021-05-27
  • 2021-11-05
相关资源
相似解决方案