Hello I want to get select query with send row record number
$row = 3;
SELECT FROM clients WHERE ROW()=$row ORDER BY ID DESC
it is possible ? How can i do that ?
Hello I want to get select query with send row record number
$row = 3;
SELECT FROM clients WHERE ROW()=$row ORDER BY ID DESC
it is possible ? How can i do that ?
If you want the third row, use offset
/limit
:
select *
from clients
order by id
offset 2
limit 1;
Note that that offset 0
gets the first record, so offset 2 would be the third record.
You need to use LIMIT
instead of WHERE
If you want get a row with N position, you can try this:
SELECT * FROM clients LIMIT N-1,1
So if you want get third row you need to use something like this:
SELECT * FROM clients LIMIT 2,1
This is what i would do.. entry_id is unique and 1 = first row, 2 = second row, etc..
entry_id is set as primary index and auto increase..
entry_id | what | ever | records
1 | a | b | c
2 | a | b | c
3 | b | c | a
4 | a | b | c
5 | a | b | c
$row = 3;
Select * From clients Where entry_id = $row
returns third row, 3, b, c, a