gpt4 book ai didi

php - 从数据库中仅选择 8 行

转载 作者:太空宇宙 更新时间:2023-11-03 12:17:25 26 4
gpt4 key购买 nike

我目前正在开发一个社交网络。我想要一个从表中选择前 8 行的 MySQL 查询。假设我在一个表中有 100 行,我将如何选择前 8 行?

最佳答案

试试这个:

$query = mysql_query("SELECT * FROM friends WHERE user='$user'
OR user2='$user' LIMIT 8")

关于php - 从数据库中仅选择 8 行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21496175/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com