This needs a subquery for each household_id.  Query first for the results of last_name LIKE
'$startswith%' and then in your WHILE loop fetching those results, make another query for all
children matching each individual household_id. 





>
> $result2 = mysql_query("select * from children, heads_of_household
> where ((children.household_id = heads_of_household.household_id) and
> (heads_of_household.last_name like '$startswith%')) order by name") or
> die("Couldn't run query #2.");









Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




YAHOO! GROUPS LINKS




Reply via email to