he I have fixed php-mysql-maintenance and making explorer function it's realy nice+javascript to making new record:
##step 1:
##place thisscript to file lib.inc.php from tobias
function count_records($db,$table){$result=mysql_db_query($db, "select count() as num from $table");$num=mysql_result($result,0,"num");echo $num;}
function my_count_records($db,$table){$result=mysql_db_query($db, "select count() as num from $table");$num=mysql_result($result,0,"num");return $num;}
function get_table_csv($db, $table, $sep, $handler)
{ $result = mysql_db_query($db, "DESCRIBE $table") or mysql_die();$schema_insert = "";
$s="";
while($tmp=mysql_fetch_object($result)){
$hasil=$tmp->Field;
if(!isset($hasil)){$schema_insert.=$s."NULL";}
elseif($hasil!=""){$schema_insert.=$s."$hasil";}
else{$schema_insert .=$s."";}
$s=$sep;
}
@mysql_free_result($result);
///// imam
// $schema_insert = ereg_replace($sep."$", "", $schema_insert);
$handler(trim($schema_insert));
$result = mysql_db_query($db, "SELECT * FROM $table") or mysql_die(); $i = 0;
while ($row = mysql_fetch_row($result))
{ set_time_limit(60);$schema_insert = "";$s="";
for($j=0; $j<mysql_num_fields($result);$j++)
{ if (!isset($row[$j])) {$schema_insert .=$s."NULL";}
elseif($row[$j] != ""){ $schema_insert .=$s."$row[$j]";}
else{$schema_insert .=$s."";}
$s=$sep;
}
///// imam
// $schema_insert = ereg_replace($sep."$", "", $schema_insert);
$handler(trim($schema_insert));
$i++;
}
@mysql_free_result($result);
return (true);
}
function show_docu($link){
/ global $cfgManualBase, $strDocu;
if (!empty($cfgManualBase)) {return("[<a href=\"$cfgManualBase/$link\">$strDocu</a>]");}/
return "";}
function show_message($message){ if (!empty($GLOBALS['reload']) && ($GLOBALS['reload'] == "true")) { ?><script language="JavaScript1.2">parent.frames.nav.location.reload();</script><? } ?><div align="left"><table border="<?php echo $GLOBALS['cfgBorder'];?>"><tr><td bgcolor="<?php echo $GLOBALS['cfgThBgcolor'];?>"><b style="color:#ff0000">Message : <?php echo $message;?> !<b><br></td></tr><? if($GLOBALS['cfgShowSQL'] == true && !empty($GLOBALS['sql_query'])){ ?><tr><td bgcolor="<?php echo $GLOBALS['cfgBgcolorOne'];?>"><? echo $GLOBALS['strSQLQuery'].":\n<br>", nl2br($GLOBALS['sql_command']);?></td></tr><? } ?></table></div><? }
function split_string($sql, $delimiter)
{ $sql = trim($sql);
$buffer = array();
$ret = array();
$in_string = false;
for($i=0; $i<strlen($sql); $i++)
{ if($sql[$i] == $delimiter && !$in_string)
{$ret[] = substr($sql, 0, $i);$sql = substr($sql, $i + 1);$i = 0;}
if($in_string && ($sql[$i] == $in_string) && $buffer[0] != "\"){$in_string = false;}
elseif(!$in_string && ($sql[$i] == "\"" || $sql[$i] == "'") && $buffer[0] != "\"){$in_string = $sql[$i];}
$buffer[0] = $buffer[1];
$buffer[1] = $sql[$i];}
if (!empty($sql)){$ret[] = $sql;}
return($ret);
}
//---------------------------------//
//---------------------------------//
//---------------------------------//
//---------------------------------//
//---Explore table by:imamf -------//
function explore_table($dt_result)
{
global $cfgBorder, $cfgBgcolorOne, $cfgBgcolorTwo, $cfgMaxRows, $pos, $server, $db, $table, $sql_query, $sql_order, $cfgOrder, $cfgShowBlob, $goto;
global $strShowingRecords,$strSelectNumRows,$SelectNumRows,$strTotal,$strEdit,$strPrevious,$strNext,$strDelete,$strDeleted,$strPos1,$strEnd;
global $cfgFunctions;
$MaksNumRec=my_count_records($db,$table); ?>
<style type="text/css">
.myinputtext {font-family: Arial; font-size: 10pt;color:#000000;text-decoration:none;background-color:#ffffff;border:0}
.mycheckbutton{font-family: Arial; font-size: 10pt;color:#000000;text-decoration:none}
</style>
<script language="javascript">
var msg="press CTRL+J to show Function Menu!";
function mess(obj){status=msg;obj.onmouseout=new Function("status=''");}
// if(!window.top.ready){window.top.ready=new Object();window.top.ready=true;document.location.reload();}
// else window.top.ready=false;
var ns=(document.layer)?true:false;var ie=(document.all)?true:false;
function centx(d){if(!d)var d=self;if(ns) return Math.round(d.pageXOffset+d.innerWidth/2);if(ie) return Math.round(d.document.body.scrollLeft+d.document.body.clientWidth/2); }
function centy(d){if(!d)var d=self;if(ns) return Math.round(d.pageYOffset+d.innerHeight/2);if(ie) return Math.round(d.document.body.scrollTop +d.document.body.clientHeight/2);}
function pagex(d){if(!d)var d=self;if(ns) return d.pageXOffset;if(ie) return d.document.body.scrollLeft;}
function pagey(d){if(!d)var d=self;if(ns) return d.pageYOffset;if(ie) return d.document.body.scrollTop;}
function showfunct(frm,obj,call){if(!document.all)return;selectobj=obj;
var x=(event.x>centx()+200)?centx()+150:event.x;
var y=pagey()+event.y-50;
lyobj=document.all['lyfunction'];
lyobj.style.top=y;lyobj.style.left=x;lyobj.style.visibility="visible";
frm.mysql.selectedIndex=0;frm.mysql.focus();
document.all['b'].innerText="Funct for "+call;
document.onclick=new Function("clearTimeout(animid);lyobj.style.visibility='hidden';");
setanimate(frm.mysql);
return false;}
function setanimate(obj)
{ if(obj&&!this.obj){this.wrd=obj.options[0].text;this.obj=obj;}
if(!this.count) this.count=0;if(this.count>this.wrd.length)this.count=0;this.count++;
this.obj.onmouseover=new Function("clearTimeout(animid);this.options[0].text='Select One!';");
this.obj.options[0].text=this.wrd.substring(0,this.count);
animid=setTimeout("setanimate()",100);
}
function thisclick(toggle,changeval,frm)
{ if(selectedobj&&selectedobj!="") frm[selectedobj].value=0;
if(selectedmark&&selectedmark!="") frm[selectedmark].value=1;
frm[toggle].value=1;
frm[changeval].value=1;
selectedmark=changeval;
selectedobj =toggle;
}
</script><? echo "<form name='$table' action='my_tbl_save.php' method='post' encytype='multypart/formdata'>"; ?>
<div id="lyfunction" style="width:150;visibility:hidden;position:absolute;left:0;top:0;z-Index:5;border:1 outset;background-color:#EEEEEE;layer-backgroundcolor:#EEEEEE">
<div id="b" style="font-weight:bold">Funct!</div><select name="mysql" onclick="if(this.value.length!=0){d=(selectobj.value.length==0)?'':'\'';selectobj.value=this.value+'('+d+selectobj.value+d+')';}lyobj.style.visibility='hidden'"><option value="" selected>What function???</option>
<? for ($j=0; $j<count($cfgFunctions); $j++)
{ echo "<option value='$cfgFunctions[$j]'>$cfgFunctions[$j]</option>"; }
?>
</select>
</div><?
echo "<input type='hidden' name='table' value='$table'>";
echo "<input type='hidden' name='db' value='$db'>";
$query ="sql.php?sub_select=explore&server=$server&db=$db&table=$table&sql_query=".urlencode($sql_query)."&pos=$pos&sql_order=".urlencode($sql_order);
echo "<input type='hidden' name='goto' value='$query'>";
$primary = false;
if (!empty($table) && !empty($db))
{ $result = mysql_db_query($db, "SELECT COUNT() as total FROM $table") or mysql_die();
$row = mysql_fetch_array($result);
$total = $row["total"];
}
if (!isset($pos)) $pos = 0;
$pos_next = $pos + $cfgMaxRows;
$pos_prev = $pos - $cfgMaxRows;
if(isset($total) && $total>1)
{ if (isset($SelectNumRows) && $SelectNumRows!=$total)
{$selectstring = ", $SelectNumRows $strSelectNumRows";}
else{$selectstring = "";}
show_message("Trying EXPLORE TABLE->"."$strShowingRecords $pos - $pos_next ($strTotal$selectstring $se$total)");
}
else show_message("Trying EXPLORE TABLE->".$GLOBALS["strSQLQuery"]);
$tab_echo="<div id='t_table'><table border=\"0\" cellspacing=\"1\"><tr><th>NO</th>";
$sel_echo="KEYS:<select name=\"keys\">";
$x=0;$selected=false; $newinsert=""; $optselect="<option>Select your keys!</option>";
$mykeys=mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die();
while($hasil=mysql_fetch_object($mykeys)) if($hasil->Non_unique+0 == 1) $unique[$hasil->Key_name]="-NotUnique";else $unique[$hasil->Key_name]="-Unique";
@mysql_free_result($mykeys);
$my_result_header= mysql_db_query($db, "DESCRIBE $table") or mysql_die();
while ($field = mysql_fetch_object($my_result_header))
{ $deskey=(empty($field->Key))?"":" [".ereg_replace("MUL","SEC",$field->Key ).$unique[$field->Field]."]";
$start=strpos($field->Type,"(")+0;$end=strpos($field->Type,")")+0;
$sort_order=urlencode(" order by $field->Field $cfgOrder");$tab_echo.="<th>";
if (!eregi("SHOW VARIABLES|SHOW PROCESSLIST|SHOW STATUS",$sql_query))
$tab_echo.="<A HREF=\"sql.php?sub_select=explore&server=$server&db=$db&pos=$pos&sql_query=".urlencode($sql_query)."&sql_order=$sort_order&table=$table\">".$field->Field.$deskey."</a>";
else
$tab_echo.=$field->Field.$deskey;
$optselect.="<option value=\"".$field->Field."\">".$field->Field."</option>";
$delim=(eregi("DATE|TIME|DATETIME|CHAR|VARCHAR|TINYTEXT|TINYBLOB|TEXT|BLOB|MEDIUMTEXT|MEDIUMBLOB|LONGTEXT|LONGBLOB|ENUM|SET",strtoupper($field->Type)))? "'":"";
$FL[$x]['name'] =$field->Field;
if(ereg("(",$field->Type)){
$FL[$x]['type']=substr($field->Type,0,$start);
$FL[$x]['type']=strtoupper($FL[$x]['type']);
} else $FL[$x]['type']=$field->Type;
$FL[$x]['length']=substr($field->Type,$start+1,$end-$start-1);
if(empty($field->Default)){
if($delim!="'")$FL[$x]['default']=0;
else $FL[$x]['default']=(empty($field->Null))?"":"";}
else $FL[$x]['default']=$field->Default;
if($x==0) $newinsert.=$field->Field.":".$FL[$x]['length'];
else $newinsert.="|".$field->Field.":".$FL[$x]['length'];
if(strtoupper(trim($field->Field))=="DELETED")$forced=" <input type='submit' name='forced' value='Force-delete' onclick=\"if(!confirm('Are you sure want to erase Data that mark with \'DELETED=1?\' ')) return false;\" >";
echo "<input type='hidden' name='fieldsdef[$x]' value='".$FL[$x]['default']."'>";
echo "<input type='hidden' name='fields[$x]' value='".base64_encode($field->Field)."'>";
echo "<input type='hidden' name='delims[$x]' value=\"".urlencode($delim)."\">";
$sel_echo.="<option value=\"".$field->Field."\" ";
if(! $selected && $field->Key !=""){$sel_echo.="SELECTED";$selected=true;}
$sel_echo.=">".$field->Field.$deskey."</option>";
$tab_echo.="</th>"; $x++;
}
if($my_result_header) @mysql_free_result($my_result_header);
$sel_echo.="</select>";
$tab_echo.="</tr>";
echo $sel_echo;
echo "<input type='text' value='' name='word'>";
echo "<input type='button' value='find' onclick='findvalue(this.form.keys.value,this.form.word.value,this.form)'> ";
echo "<input type='submit' value='save' >".$forced;
echo $tab_echo;
$tab_echo=$sel_echo=""; $foo = $pos; $m=0;
while ($row = mysql_fetch_row($dt_result))
{ $primary_key = ""; $bgcolor = $cfgBgcolorOne;$foo % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
echo "<tr bgcolor=$bgcolor><td >".($foo+1)."</td>";
$onchange="this.form['changevalues[$m]'].value=1;";$keys=" WHERE 1 ";
for ($i=0; $i<mysql_num_fields($dt_result); $i++)
{ $delim=(eregi("DATE|TIME|DATETIME|CHAR|VARCHAR|TINYTEXT|TINYBLOB|TEXT|BLOB|MEDIUMTEXT|MEDIUMBLOB|LONGTEXT|LONGBLOB|ENUM|SET",strtoupper($FL[$i]['type'])))? "'":"";
$value=$row[$i];
if(strtoupper($FL[$i]['name'])=="DELETED") $type="checkbox";
elseif(strtoupper($FL[$i]['name'])=="TOGGLE") $type="radio";
else $type="text";
$onhelp="showfunct(document.".$table.",this,'".$FL[$i]['name']."');return false;";
echo "<td>";
if($type=="checkbox"){
$checked=($value+0 == 1)?"checked":"";
echo "<input type=\"hidden\" name=\"rowdata[$m][$i]\" value=\"$value\">";
echo "<input class='mycheckbutton' onchange=\"$onchange\" onclick=\"if(this.checked)this.form['rowdata[$m][$i]'].value=1;else this.form['rowdata[$m][$i]'].value=0;\" type=\"checkbox\" $checked>";
}
elseif($type=="radio")
{ if($value+0 == 1){ $checked="checked"; $selectedobj="'rowdata[$m][$i]'"; $selectedmark="'changevalues[$m]'";} else $checked="";
echo "<input type=\"hidden\" name=\"rowdata[$m][$i]\" value=\"$value\" >";
echo "<input type=\"radio\" class='mycheckbutton' name=\"selopt\" onclick=\"thisclick('rowdata[$m][$i]','changevalues[$m]',this.form)\" value=\"\" $checked>";
}
else{
$leng=$FL[$i]['length'];
echo "<input onkeypress=\"if(event.ctrlKey && event.keyCode==10){".$onchange.$onhelp."}\" onchange=\"$onchange\" onfocus=\"mess(this)\" id=\"".$FL[$i]['name']."\" name=\"rowdata[$m][$i]\" class=\"myinputtext\" type=\"text\" value=\"$value\" maxlength=\"$leng\" size=\"$leng\">";
}
$keys.=" AND ".$FL[$i]['name']."=".$delim.addslashes($row[$i]).$delim;
echo "</td>";
}
echo "<input type='hidden' name='changevalues[$m]' value='0' >";
echo "<input type='hidden' name='keynames[$m]' value=\"".base64_encode($keys)."\">";
echo "</tr>";
$foo++; $m++;
}
echo "</table></div>";
echo "<table border=0 ><tr><td align=left>";
if ($pos >= $cfgMaxRows)
{ echo "<a href=\"sql.php?sub_select=explore&server=$server&db=$db&table=$table&sql_query=".urlencode($sql_query)."&sql_order=".urlencode($sql_order)."&pos=0\"><< $strPos1 </a> ";
echo "<a href=\"sql.php?sub_select=explore&server=$server&db=$db&table=$table&sql_query=".urlencode($sql_query)."&sql_order=".urlencode($sql_order)."&pos=$pos_prev\">< $strPrevious </a> ";
}
if (isset($total) && $pos + $cfgMaxRows < $total && mysql_num_rows($dt_result) >= $cfgMaxRows)
{ echo "<a href=\"sql.php?sub_select=explore&server=$server&db=$db&table=$table&sql_query=".urlencode($sql_query)."&sql_order=".urlencode($sql_order)."&pos=$pos_next\"> $strNext $cfgMaxRows ></a> ";
printf ("<a href=\"sql.php?sub_select=explore&server=$server&db=$db&table=$table&sql_query=%s&sql_order=%s&pos=%d\"&goto=$goto> $strEnd >></a> ",urlencode($sql_query),urlencode($sql_order),floor($total/$cfgMaxRows)$cfgMaxRows-1);
}
if($pos+$cfgMaxRows>$MaksNumRec+0){ echo "<a href=\"#\" onclick=\"addrows(document.$table)\">AddRows</a> "; }
echo "</td></tr></table></form>";
@mysql_free_result($dt_result);?><script language="javascript">
var selectedobj=<? if(isset($selectedobj))echo $selectedobj;else echo "false"; ?>;
var selectedmark=<? if(isset($selectedmark))echo $selectedmark;else echo "false"; ?>;
function addrows(frm){
if(!document.all){ alert('only available in IE!'); return; }if(!this.lastbg) this.lastbg="<? echo $bgcolor;?>"; if(!this.x) this.x=0; if(!this.num) this.num=<? echo $foo+1;?>; var newinsert="<? echo $newinsert;?>";var tmpdat=newinsert.split("|"); var cfgcol1="<? echo $cfgBgcolorOne;?>";var cfgcol2="<? echo $cfgBgcolorTwo;?>";var lya=document.all['t_table'];
var lydat=lya.innerHTML.substring(0,lya.innerHTML.indexOf("</TBODY>"));
var bgcol=(this.lastbg == cfgcol1 ) ? cfgcol2 : cfgcol1; this.lastbg=bgcol;var obj="<tr bgcolor='"+bgcol+"'><td >"+(this.num)+"</td>";var dat=objname=e_onclick=e_onfocus=e_unfocus="";var e_keypress=e_onhelp=defval="";
for(i=0;i<tmpdat.length;i++){
defval=frm["fieldsdef["+i+"]"].value;
dat=tmpdat.split(":");obj+="<td>";
objname=dat[0];
e_onhelp="showfunct(document.<? echo $table;?>,this,'"+objname+"');return false;";
e_keypress="if(event.ctrlKey && event.keyCode==10){ "+e_onhelp+"}";
if(objname.toUpperCase()=="DELETED"){e_onclick="if(this.checked)this.form['newrows["+this.x+"]["+i+"]'].value=1;else this.form['newrows["+this.x+"]["+i+"]'].value=0;";obj+="<input type='checkbox' class='mycheckbutton' onclick=\""+e_onclick+"\" >";obj+="<input type='hidden' name='newrows["+this.x+"]["+i+"]' value='0' >";}
else if(objname.toUpperCase()=="TOGGLE"){
e_onclick="thisclick('newrows["+this.x+"]["+i+"]','newvalues["+this.x+"]',this.form)";
obj+="<input type='hidden' name='newrows["+this.x+"]["+i+"]' value='0' >";
obj+="<input type='radio' name=\"selopt\" class='mycheckbutton' onclick=\""+e_onclick+"\" value=\"\" >";
}
else obj+="<input class='myinputtext' type='text' id='"+objname+"' name='newrows["+this.x+"]["+i+"]' size='"+dat[1]+"' maxlength='"+dat[1]+"' value='"+defval+"' onfocus='mess(this)' onkeypress=\""+e_keypress+"\">";
obj+="</td>";
}
obj+="<input type='hidden' value='1' name='newvalues["+this.x+"]'>";obj+="</tr>";
lya.innerHTML=lydat+obj+"</TBODY></TABLE>"; this.x++; this.num++;
}
function findvalue(key,val,frm){var mkeys=val;val=val.toUpperCase();if(val==""){alert("You must Enter Value!");return;}result=false;for(x=0;x<frm.length;x++){if(frm[x].id.substring(0,key.length)==key && frm[x].value.toUpperCase()==val){frm[x].style.filter='invert';frm[x].onclick=new Function("this.style.filter=''");result=true;if(confirm("FIND FOR-> "+key+"='"+val+"'\nResult:"+result+"\nFind Again ?")){frm[x].style.filter='';result=false;continue;}else{frm[x].focus();break;}}} if(!result){if(confirm("Sorry, can't found result for->"+key+"='"+val+"' again !\nTry search next data in server?")){
var sql_query="<? echo "my_sql_query.php?sub_select=explore&server=$server&db=$db&zero_rows=$strSuccess&table=$table&pos=$pos&goto=$query";?>";
sql_query+="&sql_query=SELECT * FROM <? echo $table; ?> WHERE "+key+" LIKE '"+mkeys+"' LIMIT <? echo $cfgMaxRows;?>";
document.location=sql_query;
}}}
</script><?
} ?>
##step 2:
##delete file name sql.php
##making new empty ones
##write this script and save
<?
header ("Expires: Mon, 26 Jul 1700 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
require("lib.inc.php");
$no_require = true;
if (isset($btnDrop) && $btnDrop == $strNo)
{ if (file_exists($goto))
{ include($goto); }
else
{ Header("Location: $goto"); }
exit;
}
$is_drop_sql_query = eregi("DROP +TABLE|DATABASE|ALTER TABLE +[[:alnum:]]* +DROP|DELETE FROM", $sql_query);
if(!$cfgConfirm){ $btnDrop = $strYes; } //belum dikonfirm
if ($is_drop_sql_query && !isset($btnDrop)) //ada perintah drop tapi variabel confirm tdk ada
{ include("header.inc.php");
echo $strDoYouReally.urldecode(stripslashes($sql_query))."?<br>"; ?>
<form action="sql.php" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="sql_query" value="<?php echo urldecode(stripslashes($sql_query)); ?>">
<input type="hidden" name="server" value="<?php echo $server ?>">
<input type="hidden" name="db" value="<?php echo $db ?>">
<input type="hidden" name="zero_rows" value="<?php echo $zero_rows;?>">
<input type="hidden" name="table" value="<?php echo $table;?>">
<input type="hidden" name="goto" value="<?php echo $goto;?>">
<input type="hidden" name="reload" value="<?php echo $reload;?>">
<input type="Submit" name="btnDrop" value="<?php echo $strYes; ?>">
<input type="Submit" name="btnDrop" value="<?php echo $strNo; ?>">
</form>
<?php }
else{
$sql_query = isset($sql_query) ? stripslashes($sql_query) : ''; //hilangkan tanda \
$sql_order = isset($sql_order) ? stripslashes($sql_order) : ''; //hilangkan tanda \
$sql_limit = isset($pos) ? " LIMIT $pos, $cfgMaxRows" : '';$sql_command="";
$sql_command="";
if(!eregi("LIMIT",$sql_query)) $sql_command.=$sql_query.$sql_order.$sql_limit;
else $sql_command=$sql_query;
$result = mysql_db_query($db, $sql_command) or mysql_die($error);
if(!$result){$error = mysql_error(); include("header.inc.php"); }
$num_rows = @mysql_num_rows($result); //hitung baris
########
include_once("header.inc.php");
if(isset($sub_select)&&$sub_select=="explore") explore_table($result);
else{
####
if ($num_rows < 1) // jika jumlah baris hasilnya kurang dari 1
{ if (file_exists($goto)) {
include("header.inc.php");if (isset($zero_rows) && !empty($zero_rows)) $message = $zero_rows;
else $message = $strEmptyResultSet;
include($goto);
}
else{
$message = $zero_rows;
$goto.="&message=$message";
Header("Location: $goto");
}
exit;
}
else
{ include("header.inc.php");
if(isset($sub_select)&&$sub_select=="explore") explore_table($result);
else{ display_table($result);
if (!eregi("SHOW VARIABLES|SHOW PROCESSLIST|SHOW STATUS", $sql_query))
echo "<p><a href=\"tbl_change.php?server=$server&db=$db&table=$table&goto=sql.php?".urlencode($GLOBALS['QUERY_STRING'])."\"> $strInsertNewRow</a></p>";
}
}
########
}
########
}
require ("footer.inc.php");
?>
##step 3 :
##delete file db_details.php
##and making new empty ones
##write this script and save
<?php
/ $Id: db_details.php,v 1.18 1999/11/22 17:08:40 tobias Exp $ /
if (!isset($message))
{
include("header.inc.php");
}
else
{
show_message($message);
}
$tables = mysql_list_tables($db);
$num_tables = @mysql_numrows($tables);
if ($num_tables == 0)
{
echo $strNoTablesFound;
}
else
{
$i = 0;
echo "<table border=$cfgBorder>\n";
echo "<th>$strTable</th>";
echo "<th colspan=6>$strAction</th>";
echo "<th>$strRecords</th>";
while ($i < $num_tables)
{
$table = mysql_tablename($tables, $i);
$query = "?server=$server&db=$db&table=$table&goto=db_details.php";
$bgcolor = $cfgBgcolorOne;
$i % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
?>
<tr bgcolor="<?php echo $bgcolor;?>">
<td class=data><b><?php echo $table;?></b></td>
<td><a href="sql.php<?php echo $query;?>&sql_query=<?php echo urlencode("SELECT * FROM $table");?>&pos=0"><?php echo $strBrowse; ?></a></td>
<td><a href="sql.php?sub_select=explore&sql_query=<?php echo urlencode("SELECT * FROM $table");?>&pos=0&<?php echo $query;?>"><?php echo $strExplore;?></a></td>
<td><a href="tbl_select.php<?php echo $query;?>"><?php echo $strSelect; ?></a></td>
<td><a href="tbl_change.php<?php echo $query;?>"><?php echo $strInsert; ?></a></td>
<td><a href="tbl_properties.php<?php echo $query;?>"><?php echo $strProperties; ?></a></td>
<td><a href="sql.php<?php echo $query;?>&reload=true&sql_query=<?php echo urlencode("DROP TABLE $table");?>&zero_rows=<?php echo urlencode($strTable." ".$table." ".$strHasBeenDropped);?>"><?php echo $strDrop; ?></a></td>
<td><a href="sql.php<?php echo $query;?>&sql_query=<?php echo urlencode("DELETE FROM $table");?>&zero_rows=<?php echo urlencode($strTable." ".$table." ".$strHasBeenEmptied);?>"><?php echo $strEmpty; ?></a></td>
<td align="right"> <?php count_records($db,$table) ?></td>
</tr>
<?php
$i++;
}
echo "</table>\n";
}
?>
<hr>
<div align="left">
<form method="post" action="db_readdump.php" enctype="multipart/form-data">
<input type="hidden" name="server" value="<?php echo $server;?>">
<input type="hidden" name="db" value="<?php echo $db;?>">
<input type="hidden" name="goto" value="db_details.php">
<input type="hidden" name="zero_rows" value="<?php echo $strSuccess; ?>">
<?php echo $strRunSQLQuery.$db." ".show_docu("manual_Syntax.html#Select");?>:<br>
<textarea name="sql_query" cols="90" rows="8" ></textarea><br>
<?php echo "<i>$strOr</i> $strLocationTextfile";?>:<br>
<input type="file" name="sql_file"><br>
<input type="submit" name="SQL" value="<?php echo $strGo; ?>">
</form><br>
<a href="tbl_qbe.php<?php echo $query;?>"><?php echo $strQBE;?></a>
<form method="post" action="db_dump.php"><?php echo $strViewDumpDB;?><br>
<table>
<tr>
<td>
<input type="radio" name="what" value="structure" checked><?php echo $strStrucOnly;?>
</td>
<td>
<input type="checkbox" name="drop" value="1"><?php echo $strStrucDrop;?>
</td>
<td colspan="2">
<input type="submit" value="<?php echo $strGo;?>">
</td>
</tr>
<tr>
<td>
<input type="radio" name="what" value="data"><?php echo $strStrucData;?>
</td>
<td>
<input type="checkbox" name="asfile" value="sendit"><?php echo $strSend;?>
</td>
</tr>
</table>
<input type="hidden" name="server" value="<?php echo $server;?>">
<input type="hidden" name="db" value="<?php echo $db;?>">
</form>
<br>
<form method="post" action="tbl_create.php">
<input type="hidden" name="server" value="<?php echo $server;?>">
<input type="hidden" name="db" value="<?php echo $db;?>">
<?php echo $strCreateNewTable.$db;?>:<br>
<?php echo $strName.":"; ?> <input type="text" name="table" size="<? echo $maxsizeinput;?>"><br>
<?php echo $strFields.":"; ?> <input type="text" name="num_fields" size=2 value='1'>
<input type="submit" value="<?php echo $strGo; ?>">
</form>
<br>
<a href="sql.php?server=<?php echo $server;?>&db=<?php echo $db;?>&sql_query=<?php echo urlencode("DROP DATABASE $db");?>&zero_rows=<?php echo urlencode($strDatabase." ".$db." ".$strHasBeenDropped);?>&goto=main.php&reload=true"><?php echo $strDropDB." ".$db;?></a> <?php print show_docu("manual_Syntax.html#Drop_database");?>
</div>
<?php
require ("footer.inc.php");
?>
if U having trouble
U can download all file in www.tribuana.20m.com/php