"http://dev.mysql.com/doc/mysql/de/Column_types.html"); function MSD_mysql_connect() { global $config,$databases; $port=(isset($config['dbport']) && !empty($config['dbport'])) ? ":".$config['dbport'] : ""; $socket=(isset($config['dbsocket']) && !empty($config['dbsocket'])) ? ":".$config['dbsocket'] : ""; $config['dbconnection'] = @mysql_connect($config['dbhost'].$port.$socket,$config['dbuser'],$config['dbpass']) or die(SQLError("Datenbankverbindung",mysql_error())); if(!defined('MSD_MYSQL_VERSION')) GetMySQLVersion(); return true; } function GetMySQLVersion() { $res=MSD_query("select version()"); $row = mysql_fetch_array($res); $version=$row[0]; $new=(substr($version,0,3)>=4.1); if(!defined('MSD_MYSQL_VERSION')) define('MSD_MYSQL_VERSION', $version); if(!defined('MSD_NEW_VERSION')) define('MSD_NEW_VERSION',$new); return $version; } function MSD_query($query) { global $config; if(!isset($config['dbconnection'])) MSD_mysql_connect(); return @mysql_query($query, $config['dbconnection']); } function MSD_mysql_error() { global $config,$databases; } function SQLError($sql,$error) { global $lang,$mysql_errorhelp_ref,$config; echo '
'; } function Highlight_SQL($sql) { global $sql_keywords; $end=""; $tickstart=false; $a=@token_get_all("$sql?>"); foreach($a as $token) { if(!is_array($token)) { if($token=="`") $tickstart=!$tickstart; $end.=$token; } else { if($tickstart) $end.=$token[1]; else { switch(token_name($token[0])) { case "T_STRING": case "T_AS": case "T_FOR": $end.=(in_array(strtoupper($token[1]),$sql_keywords)) ? "".$token[1]."": $token[1]; break; case "T_IF": case "T_LOGICAL_AND": case "T_LOGICAL_OR": case "T_LOGICAL_XOR": $end.=(in_array(strtoupper($token[1]),$sql_keywords)) ? "".$token[1]."": $token[1]; break; case "T_CLOSE_TAG": case "T_OPEN_TAG": break; default: $end.=$token[1]; } } } } $end=preg_replace("/`(.*?)`/si", "`$1`", $end); return $end; } function Fieldlist($db,$tbl) { $fl=''; $res=MSD_query("SHOW FIELDS FROM `$db`.`$tbl`;"); if($res) { $fl='('; for($i=0;$i