I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records..
any suggestion??
function list_ss_cats(){ global $db; $sql = "SELECT DISTINCT(new_cat) FROM logos WHERE format =3"; $result = $db->sql_query($sql); $num = $db->sql_numrows(); while($row = $db->sql_fetchrow()){
$sql2 = "SELECT * FROM cats WHERE id='$row[new_cat]'";
$result1 = $db->sql_query($sql2);
$row1 = $db->sql_fetchrow($result1); echo $row1[en]; // this should show all 15 records but only shows the first record
Yeah, that's all it should show. It's going to show you the value for the 'en' column. Try a print_r($row1) so you can see what you've got.
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php