从分页中获取行的位置
all_ads.php
第1页23 4
Sl No. ID Ads Name Customer
----------------------------------
11 220 Test 1 Jennifer Lawrance
12 250 Test 2 Paul Walker
13 255 Test 3 Jennifer Lawrance
Sl No-通过PHP 自动递增
ID-MySql 中行的唯一编号
MySql查询
SELECT ad.id, cust.full_name
FROM ads ad
INNER JOIN customer cust ON ad.customer_id=cust.id
WHERE ad.status='active'
ORDER BY ad.created_date ASC
LIMIT 20, 20
my_ads.php
登录后,需要显示客户广告在网站中的位置我试图得到一个特定字段的Sl编号?。
E.g: Sl no for Test 3 is 13
After Jennifer Lawrance Login
Sl No. ID Ads Name
------------------------
11 220 Test 1
13 255 Test 3
试试这个。它对我有用。
if(empty($pageno) || $pageno == 1){
$srno = 1;
}
else{
$temp = $pageno-1;
$new_temp = $temp.'1';
$srno = (int)$new_temp;
}