";
if(isset($sql_query) && !empty($sql_query))
{
echo "$strSQLQuery:
";
}
if(empty($error))
echo "$strMySQLSaid ".mysql_error();
else
echo "$strMySQLSaid ".htmlspecialchars($error);
echo "\n
$strBack";
include("./footer.inc.php3");
exit;
}
function auth() {
global $cfgServer, $strAccessDenied, $strWrongUser;
//$PHP_AUTH_USER = ""; // No need to do this since err 401 allready clears that var
Header("status: 401 Unauthorized");
Header("HTTP/1.0 401 Unauthorized");
Header("WWW-authenticate: basic realm=\"phpMySQLAdmin on ".$cfgServer['host']."\"");
echo "
$strDocu]");
}
function show_message($message) {
if(!empty($GLOBALS['reload']) && ($GLOBALS['reload'] == "true"))
{
// Reload the navigation frame via JavaScript
?>
|
", nl2br(htmlspecialchars($GLOBALS['sql_query']));
if (isset($GLOBALS["sql_order"])) echo " $GLOBALS[sql_order]";
if (isset($GLOBALS["pos"])) echo " LIMIT $GLOBALS[pos], $GLOBALS[cfgMaxRows]";?>
|
$strError ";
echo "$strSQLQuery:
".htmlspecialchars($sql)."
";
if(empty($error))
echo "$strMySQLSaid ".mysql_error();
else
echo "$strMySQLSaid ".htmlspecialchars($error);
echo "\n
$strBack";
include("./footer.inc.php3");
exit;
}
// Split up large sql files into individual queries
// Version 2 18th May 2001 - Last Modified By Pete Kelly
function split_sql_file($sql, $delimiter) {
$sql = trim($sql);
$char = "";
$last_char = "";
$ret = array();
$in_string = true;
for($i=0; $i strlen($sql)) break;
}
$sql = substr($sql,0,$i) . substr($sql,$i+$j);
}
$i++;
}
return($sql);
}
// Bookmark Support
function get_bookmarks_param() {
global $cfgServers;
global $cfgServer;
global $server;
$cfgBookmark=false;
$cfgBookmark="";
$i=1;
while($i<=sizeof($cfgServers)) {
if($cfgServer['adv_auth']) {
if(($cfgServers[$i]['host']==$cfgServer['host'] || $cfgServers[$i]['host']=='') && $cfgServers[$i]['adv_auth']==true && $cfgServers[$i]['stduser']==$cfgServer['user'] && $cfgServers[$i]['stdpass']==$cfgServer['password']) {
$cfgBookmark['db']=$cfgServers[$i]['bookmarkdb'];
$cfgBookmark['table']=$cfgServers[$i]['bookmarktable'];
break;
}
}
else {
if(($cfgServers[$i]['host']==$cfgServer['host'] || $cfgServers[$i]['host']=='') && $cfgServers[$i]['adv_auth']==false && $cfgServers[$i]['user']==$cfgServer['user'] && $cfgServers[$i]['password']==$cfgServer['password']) {
$cfgBookmark['db']=$cfgServers[$i]['bookmarkdb'];
$cfgBookmark['table']=$cfgServers[$i]['bookmarktable'];
break;
}
}
$i++;
}
return $cfgBookmark;
}
function list_bookmarks($db, $cfgBookmark) {
$query="SELECT label, id FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE dbase='$db'";
// $result=mysql_db_query($cfgBookmark['db'], $query);
$result=mysql_query($query);
if($result>0 && mysql_num_rows($result)>0)
{
$flag = 1;
while($row = mysql_fetch_row($result))
{
$bookmark_list["$flag - ".$row[0]] = $row[1];
$flag++;
}
return $bookmark_list;
}
else
return false;
}
function query_bookmarks($db, $cfgBookmark, $id) {
$query="SELECT query FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE dbase='$db' AND id='$id'";
// $result=mysql_db_query($cfgBookmark['db'], $query);
$result=mysql_query($query);
$bookmark_query=mysql_result($result,0,"query");
return $bookmark_query;
}
function delete_bookmarks($db, $cfgBookmark, $id) {
$query="DELETE FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE id='$id'";
// $result=mysql_db_query($cfgBookmark['db'], $query);
$result=mysql_query($query);
}
$cfgBookmark=get_bookmarks_param();
// formats $value to byte view - staybyte - 15. June 2001
// $comma <= how many comma
// $limes <= sensitiveness
function format_byte_down($value,$limes=6,$comma=0){
$dh=pow(10,$comma);
$li=pow(10,$limes);
$returnvalue=$value;
$unit="Byte";
if ($value >= $li*1000000){
$value=round($value/(1073741824/$dh))/$dh;
$unit="GB";
}
else if ($value >= $li*1000){
$value=round($value/(1048576/$dh))/$dh;
$unit="MB";
}
else if ($value >= $li){
$value=round($value/(1024/$dh))/$dh;
$unit="KB";
}
if ($unit!="Byte") $returnvalue=number_format($value,$comma,',','.');
else $returnvalue=number_format($value,0,',','.');
return array($returnvalue,$unit);
}
// to support special characters in db names: Lem9, 2001-06-27
function db_name ($db) {
if (MYSQL_MAJOR_VERSION >= "3.23"
&& intval(MYSQL_MINOR_VERSION) >= 6) {
return "`" . $db . "`";
}
else return $db;
}
function tbl_name ($tbl) {
if (MYSQL_MAJOR_VERSION >= "3.23"
&& intval(MYSQL_MINOR_VERSION) >= 6) {
return "`" . $tbl . "`";
}
else return $tbl;
}
include ("./defines.inc.php3");
} // $__LIB_INC__
// -----------------------------------------------------------------
?>