--- C:\Users\Edward\Webs\drupal\includes\database.mysql.inc 2008-01-15 23:26:00.461000000 -0500 +++ C:\Users\Edward\Webs\drupal\includes\database.mysql.inc.formatted 2008-01-16 17:45:18.724557100 -0500 @@ -1,6 +1,7 @@ $t('MySQL database'), 'value' => ($phase == 'runtime') ? l($version, 'admin/reports/status/sql') : $version, ); - + if (version_compare($version, DRUPAL_MINIMUM_MYSQL) < 0) { $form['mysql']['severity'] = REQUIREMENT_ERROR; $form['mysql']['description'] = $t('Your MySQL Server is too old. Drupal requires at least MySQL %version.', array('%version' => DRUPAL_MINIMUM_MYSQL)); } - + return $form; } @@ -50,12 +51,12 @@ */ function db_connect($url) { $url = parse_url($url); - + // Check if MySQL support is present in PHP if (!function_exists('mysql_connect')) { _db_error_page('Unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your php.ini to see how you can enable it.'); } - + // Decode url-encoded information in the db connection string $url['user'] = urldecode($url['user']); // Test if database url has a password. @@ -67,12 +68,12 @@ } $url['host'] = urldecode($url['host']); $url['path'] = urldecode($url['path']); - + // Allow for non-standard MySQL port. if (isset($url['port'])) { $url['host'] = $url['host'] .':'. $url['port']; } - + // - TRUE makes mysql_connect() always open a new link, even if // mysql_connect() was called before with the same parameters. // This is important if you are using two databases on the same @@ -84,7 +85,7 @@ // Show error screen otherwise _db_error_page(mysql_error()); } - + // On MySQL 4.1 and later, force UTF-8. if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) { mysql_query('SET NAMES "utf8"', $connection); @@ -97,7 +98,7 @@ */ function _db_query($query, $debug = 0) { global $active_db, $queries, $user; - + if (variable_get('dev_query', 0)) { list($usec, $sec) = explode(' ', microtime()); $timer = (float)$usec + (float)$sec; @@ -111,21 +112,21 @@ $name = str_replace(array('*', '/'), '', $name); $query = '/* '. $name .' : '. $bt[2]['function'] .' */ '. $query; } - + $result = mysql_query($query, $active_db); - + if (variable_get('dev_query', 0)) { $query = $bt[2]['function'] ."\n". $query; list($usec, $sec) = explode(' ', microtime()); - $stop = (float)$usec + (float)$sec; - $diff = $stop - $timer; + $stop = (float)$usec + (float)$sec; + $diff = $stop - $timer; $queries[] = array($query, $diff); } - + if ($debug) { print '

query: '. $query .'
error:'. mysql_error($active_db) .'

'; } - + if (!mysql_errno($active_db)) { return $result; } @@ -142,6 +143,7 @@ * * @param $result * A database query result resource, as returned from db_query(). + * * @return * An object representing the next row of the result, or FALSE. The attributes * of this object are the table fields selected by the query. @@ -157,6 +159,7 @@ * * @param $result * A database query result resource, as returned from db_query(). + * * @return * An associative array representing the next row of the result, or FALSE. * The keys of this object are the names of the table fields selected by the @@ -176,6 +179,7 @@ * * @param $result * A database query result resource, as returned from db_query(). + * * @return * The resulting field or FALSE. */ @@ -229,18 +233,20 @@ * The first result row to return. * @param $count * The maximum number of result rows to return. + * * @return * A database query result resource, or FALSE if the query was not executed * correctly. */ function db_query_range($query) { - $args = func_get_args(); + $args = func_get_args(); $count = array_pop($args); - $from = array_pop($args); + $from = array_pop($args); array_shift($args); - + $query = db_prefix_tables($query); - if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + // 'All arguments in one array' syntax + if (isset($args[0]) and is_array($args[0])) { $args = $args[0]; } _db_query_callback($args, TRUE); @@ -277,6 +283,7 @@ * @param $table * The name of the temporary table to select into. This name will not be * prefixed as there is no risk of collision. + * * @return * A database query result resource, or FALSE if the query was not executed * correctly. @@ -285,9 +292,10 @@ $args = func_get_args(); $tablename = array_pop($args); array_shift($args); - + $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' Engine=HEAP SELECT', db_prefix_tables($query)); - if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + // 'All arguments in one array' syntax + if (isset($args[0]) and is_array($args[0])) { $args = $args[0]; } _db_query_callback($args, TRUE); @@ -300,6 +308,7 @@ * * @param $data * Data to encode. + * * @return * Encoded data. */ @@ -313,6 +322,7 @@ * * @param $data * Data to decode. + * * @return * Decoded data. */ @@ -365,6 +375,7 @@ * @param $table Table containing the field to set as DISTINCT * @param $field Field to set as DISTINCT * @param $query Query to apply the wrapper to + * * @return SQL query with the DISTINCT wrapper surrounding the given table.field. */ function db_distinct_field($table, $field, $query) { @@ -376,3 +387,4 @@ /** * @} End of "ingroup database". */ +