I am trying to speed this code up, I just need the 2 latest ID's from this table in my DB is there a faster way to get these?
<? $sql_latest="select auto_id from friend_reg_user where status='Active' and auto_id!='$info[auto_id]' order by auto_id DESC limit 0,2";
$result_latest=executequery($sql_latest); ?>
<? if($line_latest=mysql_fetch_array($result_latest)){ ?>
<?=show_user_photo($line_latest[auto_id],$photo_type='small',$user_name='yes') ?> <? } ?>
<? if($line_latest=mysql_fetch_array($result_latest)){ ?>
<?=show_user_photo($line_latest[auto_id],$photo_type='small',$user_name='yes') ?> <? } ?>
higher up on the page I already have 1 DB call to this same table like this
$sql="SELECT
status
,uniqid
,view
,last_visit
,photo_view
,online
,featured
,topfriendslist
,topfriendsno
,publicview
,IP_ADD
,refnumber
FROM
friend_reg_user
WHERE
auto_id='$info[auto_id]' and status='Active'";
//$sql="select * from friend_reg_user where auto_id='$info[auto_id]' and status='Active'";
$result_user=executeQuery($sql);