</li>\r
<li>MySQL:\r
<?php\r
+ // Turn on output buffer\r
+ // Needed to repress the output of the sql function that are\r
+ // not part of php (in this case the @ operator doesn't work) \r
+ ob_start();\r
// note: this piece of code is taken from phpMyAdmin\r
$conn = sql_connect_args('localhost','','');\r
- $result = @at_sql_query('SELECT VERSION() AS version', $conn);\r
+ $result = @sql_query('SELECT VERSION() AS version', $conn);\r
if ($result != FALSE && sql_num_rows($result) > 0) {\r
$row = sql_fetch_array($result);\r
$match = explode('.', $row['version']);\r
} else {\r
- $result = @at_sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
+ $result = @sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
if ($result != FALSE && @sql_num_rows($result) > 0) {\r
$row = sql_fetch_row($result);\r
$match = explode('.', $row[1]);\r
}\r
}\r
}\r
-\r
- sql_disconnect($conn);\r
+ @sql_disconnect($conn);\r
+ //End and clean output buffer\r
+ ob_end_clean();\r
$mysqlVersion = implode($match, '.');\r
$minVersion = '3.23';\r
\r
# mysql_ tablename (deprecated)
*******************************************************************/
-
- /**
- * for JP installer only
- */
- function at_sql_query($query, $conn = false) {
- global $SQLCount,$MYSQL_CONN;
- if (!$conn) $conn = $MYSQL_CONN;
- $SQLCount++;
- $res = mysql_query($query,$conn);
- return $res;
- }
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
# mysql_ tablename (deprecated)
*******************************************************************/
-
- /**
- * for JP installer only
- */
- function at_sql_query($query,$dbh=NULL) {
- global $SQLCount,$SQL_DBH;
- $SQLCount++;
- if (is_null($dbh)) $res = $SQL_DBH->query($query);
- else $res = $dbh->query($query);
-/* if ($res->errorCode() != '00000') {
- $errors = $res->errorInfo();
- print("SQL error with query $query: " . $errors[0].'-'.$errors[1].' '.$errors[2] . '<p />');
- }
-*/
- return $res;
- }
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file