比方说,我有以下几点:从响应状态获取行号
$variable = SELECT * FROM `accounts` order by `creation_date`
账目表保存:
| id | username | creation_date | ...
如果$variable
输出以下:
响应:
| id | username | creation_date|
| 2 | bob | 1 |
| 4 | jesus | 2 |
| 8 | vanessa | 4 |
| 5 | user1 | 43 |
在这个Jesus
之前,真正获得$ variable中发生的行数是一个好方法吗?在这种情况下,执行查询时将是第二行。
我确实知道其他方法,比如做一个foreach
并检查每个人的jesus
,但我希望有更好的解决方案呢?
我打算在每个页面上刷新,执行此查询并查找人员行。所以foreach/while循环会不会很慢?
SELECT * FROM'accounts'其中username = '耶稣' – splash58
@ splash58但我不从spesific查询得到它的行... – maria
我不不明白 - 你想按序列号排列吗? – splash58