我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何订购DESC并横向显示PHP [关闭]

I was wondering how I would order something DESC but then make all the results display horizontally instead of vertically.

$sql = "SELECT name WHERE id > 5 ORDER BY id DESC";

You can put all the names in a comma-separated list, using group_concat():

select group_concat(name order by id) as names
from t
where id > 5

You can then break out each name from the list. (And, if the comma is not the right separator, you can use the separator keyword.)

近期文章

  • 字符串的组合和合并
  • 使用php下载图像,同时调整大小
  • 如何在特定时间检查时间,然后执行操作
  • 如何使用PHP / MySQL基于表的行创建特定大小的随机数?
  • 获取查询字符串的值
  • 基于Web的零件库存设计
  • PHP或MySql不会更新数据库
  • Php循环$ a =新的ShipPackage('UPS');
  • 我的“if语句”语法错误[关闭]
  • PHP:在非对象上调用成员函数GetUserCollection()[关闭]
  • php glob不读取垂直图像[关闭]
  • 包含何时调用函数[关闭]
  • 基本搜索引擎无法正常工作
  • 使用属性运行PHP
  • 如何在php中查询excel文件?
  • 查询和回声解决方案? [关闭]
  • Android中的动态数据[关闭]
  • 如何从iPad发送数据到php页面? [关闭]
  • PHP文本框阻止特殊字符
  • 如何使用PHP [重复]将HTML转换为PDF格式

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华