Mathias 426 Report post Posted August 19, 2007 Note, all of my functions belong to classes, but I am posting only snippets of my functions to avoid boredom and giving away all my secrets. Please post corrections, suggestions, and your own related functions. Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites
Mathias 426 Report post Posted August 19, 2007 //------------------------------------------------------------------------- // Function: mysqlSelect // Author: Andrew Hinkle // Modified: 06/20/2007 // Description: Return the select query results in an array. //------------------------------------------------------------------------- public function mysqlSelect($sSQL) { // Was the database connected? if (empty($this->_pConnect)) return 0; // Run the query and capture the results. $mResult = mysql_query($sSQL); // Return an empty array if no results were returned. if (empty($mResult)) return array(); // Convert the mysql result to a standard array. $aResult = array(); while ($aFetched = @mysql_fetch_array($mResult, MYSQL_ASSOC)) { // Append the fetched array to the result array. $aResult[] = $aFetched; } // mysql memory clean up. @mysql_free_result($mResult); return $aResult; }[/CODE] Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites
Mathias 426 Report post Posted August 19, 2007 //------------------------------------------------------------------------- // Function: mysqlQuery // Author: Andrew Hinkle // Modified: 06/20/2007 // Description: Run the query on the table, but do not return any results. //------------------------------------------------------------------------- public function mysqlQuery($sSQL) { // Was the database connected? if (empty($this->_pConnect)) return (0); // Run the query and capture the results. $mResult = mysql_query($sSQL); // Results were not returned. if (empty($mResult)) return 0; // mysql memory clean up. @mysql_free_result($mResult); // Results were returned and freed. return 1; }[/CODE] Quote Understand this lad, fate is a fickle lady. Work with the hand you're dealt and you may just be able to run your flag up the pole. Don't, and well, you may just find your mast cut down. Share this post Link to post Share on other sites
dhoom 0 Report post Posted October 25, 2014 thanks for the commands ................ Quote dhoom Share this post Link to post Share on other sites