Dear all,
I want to get the first 4 row of data in php in the following,
$sql="select id,num
from data where num >0 order by id ASC limit 4";
For example, the table "data" contains 10 rows of data, the data (id,num) in the table are shown below.
(1,2), (1,3),(1,1),
(1,4), (1,5),(1,4),
(1,4), (1,6),(1,1),
(1,8)
if the data is arranged in ascending order,
(1,1),(1,1),(1,2),(1,3),(1,4),(1,4),(1,4),(1,5),(1,6),(1,8)
This means the fourth data is (1,4) which contain three elements. Then I want to select all the data with (1,4)s. All the data we select is
(1,1),(1,1),(1,2),(1,3),(1,4),(1,4),(1,4)
Please give me some help on the sql command, thanks
Simon