UPDATE: 30.06.2013
$phonesRelated = $DB->getRandom(" `".DB_PREFIX."phones` a, `".DB_PREFIX."phones_categories` b ", " a.id ", " AND a.id=b.phone_id AND b.phone_id!='".$phone['id']."' AND b.category_id IN (".implode(",", $arr).") GROUP BY a.id", 3);
$smarty->assign("phones", $phonesRelated);
Hi,
".DB_PREFIX."phones
- represent the table with phones which have more columns (once is ID)".DB_PREFIX."phones_categories
- represent the table with 2 columns (phone_id[have the same number with ID from".DB_PREFIX."phones
] and category_id[is the number of the category])
example: we're on webpage iphone3 which have the ID=7 in table ".DB_PREFIX."phones
on column ID
.
What i need is to make the query return the phones ID after the ID=7 -> ID=8,ID=9,ID=10. At this moment the query returns records by IDs from the end of the table ".DB_PREFIX."phones_categories
which are ID=46,ID=47,ID=48.
Can someone help me with a hint of what to add at the code to make it return the consecutive IDs?