Again bug #440430 (error with php3)

This commit is contained in:
Loïc Chapeaux
2001-07-11 21:28:17 +00:00
parent 3edc8181b3
commit a405dc8fbd

View File

@@ -6,16 +6,30 @@ require("./config.inc.php3");
if(!defined("__LIB_INC__")){ if(!defined("__LIB_INC__")){
define("__LIB_INC__", 1); define("__LIB_INC__", 1);
// load the mysql extensions or not - staybyte - 26. June 2001 /**
if (defined("PHP_OS") && eregi("win", PHP_OS)) $suffix=".dll"; * Load the mysql extensions or not - staybyte - 26. June 2001
else $suffix=".so"; */
if (intval(phpversion())==3) $extension="MySQL"; if ((intval(phpversion()) == 3 && substr(phpversion(), 4) > 9)
else $extension="mysql"; || intval(phpversion()) == 4) {
if (!@extension_loaded($extension) && !@get_cfg_var('safe_mode')) @dl($extension.$suffix); if (defined('PHP_OS') && eregi('win', PHP_OS)) {
if (!@extension_loaded($extension)){ $suffix = '.dll';
echo $strCantLoadMySQL; } else {
exit; $suffix = '.so';
} }
if (intval(phpversion()) == 3) {
$extension = 'MySQL';
} else {
$extension = 'mysql';
}
if (!@extension_loaded($extension) && !@get_cfg_var('safe_mode')) {
@dl($extension.$suffix);
}
if (!@extension_loaded($extension)) {
echo $strCantLoadMySQL;
exit();
}
} // end load mysql extension
function show_table_navigation($pos_next, $pos_prev, $dt_result) { function show_table_navigation($pos_next, $pos_prev, $dt_result) {
global $pos, $cfgMaxRows, $lang, $server, $db, $table, $sql_query; global $pos, $cfgMaxRows, $lang, $server, $db, $table, $sql_query;
@@ -313,8 +327,7 @@ function display_table ($dt_result, $is_simple = false) {
$primary = false; $primary = false;
if(!$is_simple && !empty($table) && !empty($db)) { if(!$is_simple && !empty($table) && !empty($db)) {
$result = mysql_query("SELECT COUNT(*) as total FROM " .db_name($db). $result = mysql_query("SELECT COUNT(*) as total FROM " . db_name($db) . "." . tbl_name($table)) or mysql_die();
"." . tbl_name($table)) or mysql_die();
$row = mysql_fetch_array($result); $row = mysql_fetch_array($result);
$total = $row["total"]; $total = $row["total"];
} }
@@ -516,8 +529,7 @@ function get_table_def($db, $table, $crlf)
// modified by Lem9 to allow older MySQL versions to continue to work // modified by Lem9 to allow older MySQL versions to continue to work
if(MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 20){ if(MYSQL_MAJOR_VERSION == "3.23" && intval(MYSQL_MINOR_VERSION) > 20){
$result=mysql_query("show create table " .db_name($db)."." $result=mysql_query("show create table " . db_name($db) . "." . tbl_name($table));
. tbl_name($table));
if ($result!=false && mysql_num_rows($result)>0){ if ($result!=false && mysql_num_rows($result)>0){
$tmpres=mysql_fetch_array($result); $tmpres=mysql_fetch_array($result);
$tmp=$tmpres[1]; $tmp=$tmpres[1];