MySQL Forums
Forum List  »  PHP

Re: Showing recordsets from tables with one (main table) to many (secondary table) relationship
Posted by: Kostas Telias
Date: January 19, 2011 10:32AM

Thank you Rick.

Finally, the question for which i started this 'large' thread (it appears in the thread topic): in a specific moment in the application, i need to show, for each specie (main table: tbltaxonomia), its vernacular names (secondary table: tblnombresvernaculos). Is there a better way of doing than this:

$resultVernaculaNames=$conn->query("SELECT * FROM tblnombresvernaculos WHERE Id=$rowspecie[0] ORDER BY order");
while ($rowVernacularNames=$resultVernaculaNames->fetch_row()){
printf(
"<span class='verncaularname'>%s %s %s</span><br>",
$rowVernacularNames[1],$rowVernacularNames[2],$rowVernacularNames[3]
);
}

The table tblnombresvernaculos, like it can be understood, has four fields, the first of them is Id, the foreign key with the table tbltaxonomia.

Options: ReplyQuote


Subject
Written By
Posted
Re: Showing recordsets from tables with one (main table) to many (secondary table) relationship
January 19, 2011 10:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.