dynamically build array from db

From: Date: Tue, 08 Jun 2004 12:50:31 +0000
Subject: dynamically build array from db
Groups: php.general 
Request: Send a blank email to php-general+get-187874@lists.php.net to get a copy of this message
I have a class which builds a set of tabs...the class expects an array in this form array("Site Info"=>"siteinfo.php","Contact Us"=>"contactus.php")..where Site Info is a link to siteinfo.php. The build tabs method of the class then loops through the array outputing a set of tabbed links on the page. The problem is I am having trouble generating this array from a database. I need to pull from my query: $sql->query("select title, page from links"); while ($sql->nextRecord()){ //build the array } I have tried arraypush but can only get it to work with a standard array...how can I do this? Thanks, Eddie WARNING: The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed. This message may contain information that is privileged, confidential and exempt from disclosure under applicable law. It may also contain trade secrets and other proprietary information for which you and your employer may be held liable for disclosing. You are hereby notified that any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify HIPAA@echoman.com by E-Mail and then destroy this communication in a manner appropriate for privileged information.

« previous php.general (#187874) next »