- <?php
- /**
- * FetchNextResult Example
- *
- * This example uses the FetchNextResult[Assoc, Object, Row] functions to retrieve query results.
- * The method shown in this example uses FetchNextResultRow but the other functions would be used
- * in the same way.
- * @package AbstractDB
- * @author Pacific-Cybersoft
- * @copyright (C) 2005 Pacific-Cybersoft. All Rights Reserved.
- * @version v 1.0.2
- * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
- */
- /**
- * Include the AbstractDB main class.
- */
- include("../abstractdb.class.php");
- // Instatiate AbstractDB
- $db = new AbstractDB(array("ConnectionString"=>"mysql://username:password@localhost/mydatabase"));
- // Execute a Query
- if($rs = $db->Query("SELECT * FROM tablename"))
- {
- // Loop through results
- while($db->FetchNextResultRow($rs, $row))
- {
- // Do something with the data in $row.
- print_r($row);
- }
- // Free Result
- $db->FreeResult($rs);
- }
- else
- {
- die($db->GetLastError());
- }
- // Always good practice to close AbstractDB at the end of each script.
- $db->Close();
- ?>
Documentation generated on Wed, 16 Mar 2005 23:16:51 +1100 by phpDocumentor 1.3.0RC3