From 1bbf47cea6defff97a8ecd794c4c70b8b922cf7d Mon Sep 17 00:00:00 2001 From: osmiy Date: Mon, 22 May 2006 12:15:34 +0000 Subject: - fixed oracle SQL request creating (Eugene) - fixed first host selection from list of accessed hosts (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2874 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/db.inc.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'frontends/php/include/db.inc.php') diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index c2c4337c..1a998e3d 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -22,14 +22,13 @@ // DATABASE CONFIGURATION - $DB_TYPE ="ORACLE"; +// $DB_TYPE ="ORACLE"; // $DB_TYPE ="POSTGRESQL"; -// $DB_TYPE ="MYSQL"; + $DB_TYPE ="MYSQL"; $DB_SERVER ="localhost"; -// $DB_DATABASE ="zabbix"; -// $DB_DATABASE ="osmiy"; - $DB_USER ="scott"; - $DB_PASSWORD ="tiger"; + $DB_DATABASE ="zabbix"; + $DB_USER ="root"; + $DB_PASSWORD =""; // END OF DATABASE CONFIGURATION // $USER_DETAILS =""; @@ -277,11 +276,14 @@ COpt::savesqlrequest($query); } } - function zbx_dbstr($var) - { - $result = "'".addslashes($var)."'"; -//SDI($result); - return $result; - //return "'".addslashes($var)."'"; +/* string value prepearing */ +if($DB_TYPE == "ORACLE") { + function zbx_dbstr($var) { + return "'".ereg_replace('\'','\'\'',$var)."'"; + } +} else { + function zbx_dbstr($var) { + return "'".addslashes($var)."'"; } +} ?> -- cgit