PHP 同时查询两个字段并一起列出
下面是查询order_sn并列出来,我想增加个功能,就是同时查询order_sn和postscript,并一起列出来。谢谢function get_user_merge($user_id)
{
include_once(ROOT_PATH . 'includes/lib_order.php');
$sql= "SELECT order_sn FROM ".$GLOBALS['ecs']->table('order_info') .
" WHERE user_id= '$user_id' " . order_query_sql('unprocessed') .
"AND extension_code = '' ".
" ORDER BY add_time DESC";
$list = $GLOBALS['db']->GetCol($sql);
$merge = array();
foreach ($list as $val)
{
$merge[$val] = $val;
}
return $merge;
} function get_user_merge($user_id)
{
include_once(ROOT_PATH . 'includes/lib_order.php');
$sql= "SELECT order_sn,postscript FROM ".$GLOBALS['ecs']->table('order_info') .
" WHERE user_id= '$user_id' " . order_query_sql('unprocessed') .
"AND extension_code = '' ".
" ORDER BY add_time DESC";
$list = $GLOBALS['db']->GetCol($sql);
$merge = array();
foreach ($list as $val)
{
$merge[$val] = $val;
}
return $merge;
}
直接加上 查出来就好了吧 秋天811 发表于 2015-6-28 17:33
直接加上 查出来就好了吧
已经用别的方法解决了,这分也送你啦。:lol:
页:
[1]