WebHostingPhp.net

Title

Web Hosting PHP - PHP4, PHP5 Programming Blog

Description

Excerpted from the website:

} The function getSearchResults() executes the $searchStmtquery and returns the result as an array of Book_Item objects: function getSearchResults($searchStmt) { Get the database connection: $functionResult = getDBConnection(); if ($functionResult->returnValue == null) { return $functionResult; } $link = $functionResult->returnValue; Execute the $searchStmt SQL query: if (!($result = mysql_query($searchStmt, $link))) { return new Function_Result(”Internal Error: Could not execute sql query”, null); } $searchResults = null; while (($row = mysql_fetch_array($result, MYSQL_NUM))) { For each retrieved row, add a Book_Item object to $searchResultsarray: $searchResults[] = new Book_Item($row[0], $row[1], $row[2], $row[3], $row[4]); } mysql_free_result($result); Return the $searchResultsarray: return new Function_Result(null, $searchResults); } } ?> The Music_Shop Class The script MusicShop.php contains the class definition of Music_Shop class:


Retrieved from "http://aboutus.com/index.php?title=WebHostingPhp.net&oldid=11457303"