标签:订单号 sele name fetch 不重复 订单 select color 一个
1、目的:利用php的do .. while 生成一个不重复的字符串或者数组,比如(订单号、会员号)
2、不废话,代码来:
$repeat_order = array(); do{ $ordersn = date(‘md‘) . random(8, 1); $repeat_order = pdo_fetch("SELECT * FROM ".tablename($tablename)." WHERE weid = ‘{$_W[‘uniacid‘]}‘ AND ordersn = :ordersn", array(‘:ordersn‘ => $ordersn)); }while(!empty($repeat_order));
标签:订单号 sele name fetch 不重复 订单 select color 一个
原文地址:https://www.cnblogs.com/xuzhengzong/p/9675348.html