About 81,140 results: "php array_keys"
Page 1 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On





  1. set_session($w,$X){$_SESSION[$w][DRIVER][SERVER][$_GET["username"]]=$X;}function
  2. auth_url($Db,$L,$V,$k=null){global$Eb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($Eb))."|username|".($k!==null?"db|":"").session_name()),$_);return"$_[1]?".(sid()?SID."&":"").($Db!="server"||$L!=""?urlencode($Db)."=".urlencode($L)."&":"")."username=".urlencode($V).($k!=""?"&db=".urlencode($k):"").($_[2]?"&$_[2]":"");}function
  3. ';}else$i=null;ob_flush();flush();$H=@get_key_vals($F,$i);if($i){echo"<script type='text/javascript'>clearTimeout(timeout);</script>\n";ob_flush();flush();}return
  4. array_keys($H);}function
  5. 2;$f[]=$ne[$e];}$f="(".implode(", ",$f).")";if($t["type"]!="PRIMARY")$u[]=array($t["type"],$cd,$f);elseif(!$Ie)$rc[]="  PRIMARY KEY $f";}}$c=array_merge($c,$rc);if(!queries("CREATE TABLE ".table($P!=""?"adminer_$A":$A)." (\n".implode(",\n",$c)."\n)"))return
  6. false;if($P!=""){if($ne&&!queries("INSERT INTO ".table("adminer_$A")." (".implode(", ",$ne).") SELECT ".implode(", ",array_map('idf_escape',array_keys($ne)))." FROM ".table($P)))return
  7. insert_into($P,$M){return
  8. queries("INSERT INTO ".table($P).($M?" (".implode(", ",array_keys($M)).")\nVALUES (".implode(", ",$M).")":"DEFAULT VALUES"));}function
  9. insert_update($P,$M,$He){return
  10. queries("REPLACE INTO ".table($P)." (".implode(", ",array_keys($M)).") VALUES (".implode(", ",$M).")");}function
  11. insert_into($P,$M){return
  12. queries("INSERT INTO ".table($P).($M?" (".implode(", ",array_keys($M)).")\nVALUES (".implode(", ",$M).")":"DEFAULT VALUES"));}function
  13. insert_update($P,$M,$He){global$h;$vg=array();$Z=array();foreach($M
  14. insert_into($P,$M){return
  15. queries("INSERT INTO ".table($P)." (".implode(", ",array_keys($M)).")\nVALUES (".implode(", ",$M).")");}function
  16. support($lc){return
  17. ereg('^(scheme|trigger|view|drop_col)$',$lc);}$v="mssql";$U=array();$Df=array();foreach(array(lang(13)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(14)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(15)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(16)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$w=>$X){$U+=$X;$Df[$w]=array_keys($X);}$ug=array();$be=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$_c=array("len","lower","round","upper");$Ec=array("avg","count","count distinct","max","min","sum");$Kb=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$Eb=array("server"=>"MySQL")+$Eb;if(!defined("DRIVER")){$Ee=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class

  1. ';}else$i=null;ob_flush();flush();$H=@get_key_vals($F,$i);if($i){echo"<script type='text/javascript'>clearTimeout(timeout);</script>\n";ob_flush();flush();}return
  2. array_keys($H);}function
  3. 2;$f[]=$me[$e];}$f="(".implode(", ",$f).")";if($t["type"]!="PRIMARY")$u[]=array($t["type"],$bd,$f);elseif(!$He)$qc[]="  PRIMARY KEY $f";}}$c=array_merge($c,$qc);if(!queries("CREATE TABLE ".table($O!=""?"adminer_$A":$A)." (\n".implode(",\n",$c)."\n)"))return
  4. false;if($O!=""){if($me&&!queries("INSERT INTO ".table("adminer_$A")." (".implode(", ",$me).") SELECT ".implode(", ",array_map('idf_escape',array_keys($me)))." FROM ".table($O)))return
  5. support($kc){return
  6. ereg('^(view|trigger|variables|status|dump|move_col|drop_col)$',$kc);}$v="sqlite";$T=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$Cf=array_keys($T);$ug=array();$ae=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","");$zc=array("hex","length","lower","round","unixepoch","upper");$Dc=array("avg","count","count distinct","group_concat","max","min","sum");$Kb=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$Eb["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$De=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
  7. support($kc){return
  8. ereg('^(comment|view|scheme|processlist|sequence|trigger|type|variables|drop_col)$',$kc);}$v="pgsql";$T=array();$Cf=array();foreach(array(lang(13)=>array("smallint"=>5,"integer"=>10,"bigint"=>19,"boolean"=>1,"numeric"=>0,"real"=>7,"double precision"=>16,"money"=>20),lang(14)=>array("date"=>13,"time"=>17,"timestamp"=>20,"timestamptz"=>21,"interval"=>0),lang(15)=>array("character"=>0,"character varying"=>0,"text"=>0,"tsquery"=>0,"tsvector"=>0,"uuid"=>0,"xml"=>0),lang(16)=>array("bit"=>0,"bit varying"=>0,"bytea"=>0),lang(17)=>array("cidr"=>43,"inet"=>43,"macaddr"=>17,"txid_snapshot"=>0),lang(18)=>array("box"=>0,"circle"=>0,"line"=>0,"lseg"=>0,"path"=>0,"point"=>0,"polygon"=>0),)as$w=>$W){$T+=$W;$Cf[$w]=array_keys($W);}$ug=array();$ae=array("=","<",">","<=",">=","!=","~","!~","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$zc=array("char_length","lower","round","to_hex","to_timestamp","upper");$Dc=array("avg","count","count distinct","max","min","sum");$Kb=array(array("char"=>"md5","date|time"=>"now",),array("int|numeric|real|money"=>"+/-","date|time"=>"+ interval/- interval","char|text"=>"||",));}$Eb["oracle"]="Oracle";if(isset($_GET["oracle"])){$De=array("OCI8","PDO_OCI");define("DRIVER","oracle");if(extension_loaded("oci8")){class
  9. support($kc){return
  10. ereg("view|scheme|processlist|drop_col|variables|status",$kc);}$v="oracle";$T=array();$Cf=array();foreach(array(lang(13)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(14)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(15)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(16)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$w=>$W){$T+=$W;$Cf[$w]=array_keys($W);}$ug=array();$ae=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","");$zc=array("length","lower","round","upper");$Dc=array("avg","count","count distinct","max","min","sum");$Kb=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$Eb["mssql"]="MS SQL";if(isset($_GET["mssql"])){$De=array("SQLSRV","MSSQL");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
  11. insert_into($O,$M){return
  12. queries("INSERT INTO ".table($O).($M?" (".implode(", ",array_keys($M)).")\nVALUES (".implode(", ",$M).")":"DEFAULT VALUES"));}function
  13. support($kc){return
  14. ereg('^(scheme|trigger|view|drop_col)$',$kc);}$v="mssql";$T=array();$Cf=array();foreach(array(lang(13)=>array("tinyint"=>3,"smallint"=>5,"int"=>10,"bigint"=>20,"bit"=>1,"decimal"=>0,"real"=>12,"float"=>53,"smallmoney"=>10,"money"=>20),lang(14)=>array("date"=>10,"smalldatetime"=>19,"datetime"=>19,"datetime2"=>19,"time"=>8,"datetimeoffset"=>10),lang(15)=>array("char"=>8000,"varchar"=>8000,"text"=>2147483647,"nchar"=>4000,"nvarchar"=>4000,"ntext"=>1073741823),lang(16)=>array("binary"=>8000,"varbinary"=>8000,"image"=>2147483647),)as$w=>$W){$T+=$W;$Cf[$w]=array_keys($W);}$ug=array();$ae=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL");$zc=array("len","lower","round","upper");$Dc=array("avg","count","count distinct","max","min","sum");$Kb=array(array("date|time"=>"getdate",),array("int|decimal|real|float|money|datetime"=>"+/-","char|text"=>"+",));}$Eb=array("server"=>"MySQL")+$Eb;if(!defined("DRIVER")){$De=array("MySQLi","MySQL","PDO_MySQL");define("DRIVER","server");if(extension_loaded("mysqli")){class
  15. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  16. routine($A,$S){global$h,$Ub,$Qc,$T;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$ng="((".implode("|",array_merge(array_keys($T),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Ub)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ye="\\s*(".($S=="FUNCTION"?"":$Qc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$ng";$lb=$h->result("SHOW CREATE $S ".idf_escape($A),2);preg_match("~\\(((?:$ye\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$ng\\s+":"")."(.*)~is",$lb,$_);$n=array();preg_match_all("~$ye\\s*,?~is",$_[1],$ud,PREG_SET_ORDER);foreach($ud


  1. set_session($v,$W){$_SESSION[$v][DRIVER][SERVER][$_GET["username"]]=$W;}function
  2. auth_url($vb,$J,$U,$j=null){global$wb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($wb))."|username|".($j!==null?"db|":"").session_name()),$z);return"$z[1]?".(sid()?SID."&":"").($vb!="server"||$J!=""?urlencode($vb)."=".urlencode($J)."&":"")."username=".urlencode($U).($j!=""?"&db=".urlencode($j):"").($z[2]?"&$z[2]":"");}function
  3. support($bc){return
  4. ereg('^(view|trigger|variables|status|dump)$',$bc);}$u="sqlite";$T=array("integer"=>0,"real"=>0,"numeric"=>0,"text"=>0,"blob"=>0);$kf=array_keys($T);$Xf=array();$Ld=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT IN","IS NOT NULL","");$qc=array("hex","length","lower","round","unixepoch","upper");$vc=array("avg","count","count distinct","group_concat","max","min","sum");$Bb=array(array(),array("integer|real|numeric"=>"+/-","text"=>"||",));}$wb["pgsql"]="PostgreSQL";if(isset($_GET["pgsql"])){$pe=array("PgSQL","PDO_PgSQL");define("DRIVER","pgsql");if(extension_loaded("pgsql")){class
  5. insert_into($N,$K){return
  6. queries("INSERT INTO ".table($N).($K?" (".implode(", ",array_keys($K)).")\nVALUES (".implode(", ",$K).")":"DEFAULT VALUES"));}function
  7. insert_update($N,$K,$se){global$g;$Yf=array();$Z=array();foreach($K
  8. as$v=>$W){$Yf[]="$v = $W";if(isset($se[idf_unescape($v)]))$Z[]="$v = $W";}return($Z&&queries("UPDATE ".table($N)." SET ".implode(", ",$Yf)." WHERE ".implode(" AND ",$Z))&&$g->affected_rows)||queries("INSERT INTO ".table($N)." (".implode(", ",array_keys($K)).") VALUES (".implode(", ",$K).")");}function
  9. insert_into($N,$K){return
  10. queries("INSERT INTO ".table($N)." (".implode(", ",array_keys($K)).")\nVALUES (".implode(", ",$K).")");}function
  11. support($bc){return
  12. ereg("view|scheme|processlist|drop_col|variables|status",$bc);}$u="oracle";$T=array();$kf=array();foreach(array(lang(13)=>array("number"=>38,"binary_float"=>12,"binary_double"=>21),lang(14)=>array("date"=>10,"timestamp"=>29,"interval year"=>12,"interval day"=>28),lang(15)=>array("char"=>2000,"varchar2"=>4000,"nchar"=>2000,"nvarchar2"=>4000,"clob"=>4294967295,"nclob"=>4294967295),lang(16)=>array("raw"=>2000,"long raw"=>2147483648,"blob"=>4294967295,"bfile"=>4294967296),)as$v=>$W){$T+=$W;$kf[$v]=array_keys($W);}$Xf=array();$Ld=array("=","<",">","<=",">=","!=","LIKE","LIKE %%","IN","IS NULL","NOT LIKE","NOT REGEXP","NOT IN","IS NOT NULL","");$qc=array("length","lower","round","upper");$vc=array("avg","count","count distinct","max","min","sum");$Bb=array(array("date"=>"current_date","timestamp"=>"current_timestamp",),array("number|float|double"=>"+/-","date|timestamp"=>"+ interval/- interval","char|clob"=>"||",));}$wb["mssql"]="MS SQL";if(isset($_GET["mssql"])){$pe=array("SQLSRV","MSSQL");define("DRIVER","mssql");if(extension_loaded("sqlsrv")){class
  13. insert_into($N,$K){return
  14. queries("INSERT INTO ".table($N).($K?" (".implode(", ",array_keys($K)).")\nVALUES (".implode(", ",$K).")":"DEFAULT VALUES"));}function
  15. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  16. routine($_,$S){global$g,$Kb,$Hc,$T;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Qf="((".implode("|",array_merge(array_keys($T),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Kb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$je="\\s*(".($S=="FUNCTION"?"":$Hc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Qf";$fb=$g->result("SHOW CREATE $S ".idf_escape($_),2);preg_match("~\\(((?:$je\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$Qf\\s+":"")."(.*)~is",$fb,$z);$m=array();preg_match_all("~$je\\s*,?~is",$z[1],$gd,PREG_SET_ORDER);foreach($gd










  1. set_session($y,$X){$_SESSION[$y][DRIVER][SERVER][$_GET["username"]]=$X;}function
  2. auth_url($pb,$O,$If,$i=null){global$qb;preg_match('~([^?]*)\\??(.*)~',remove_from_uri(implode("|",array_keys($qb))."|username|".($i!==null?"db|":"").session_name()),$B);return"$B[1]?".(sid()?SID."&":"").($pb!="server"||$O!=""?urlencode($pb)."=".urlencode($O)."&":"")."username=".urlencode($If).($i!=""?"&db=".urlencode($i):"").($B[2]?"&$B[2]":"");}function
  3. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  4. routine($D,$V){global$f,$Eb,$vc,$yf;$pa=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$xf="((".implode("|",array_merge(array_keys($yf),$pa)).")\\b(?:\\s*\\(((?:[^'\")]*|$Eb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$F="\\s*(".($V=="FUNCTION"?"":$vc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$xf";$Za=$f->result("SHOW CREATE $V ".idf_escape($D),2);preg_match("~\\(((?:$F\\s*,?)*)\\)\\s*".($V=="FUNCTION"?"RETURNS\\s+$xf\\s+":"")."(.*)~is",$Za,$B);$l=array();preg_match_all("~$F\\s*,?~is",$B[1],$Rc,PREG_SET_ORDER);foreach($Rc
  5. array('sql'=>'SQL','csv'=>'CSV,','csv;'=>'CSV;','tsv'=>'TSV');}function
  6. dumpTable($S,$R,$_c=false){if($_POST["format"]!="sql"){echo"\xef\xbb\xbf";if($R)dump_csv(array_keys(fields($S)));}elseif($R){$Za=create_sql($S,$_POST["auto_increment"]);if($Za){if($R=="DROP+CREATE")echo"DROP ".($_c?"VIEW":"TABLE")." IF EXISTS ".table($S).";\n";if($_c)$Za=preg_replace('~^([A-Z =]+) DEFINER=`'.preg_replace('~@(.*)~','`@`(%|\\1)',logged_user()).'`~','\\1',$Za);echo($R!="CREATE+ALTER"?$Za:($_c?substr_replace($Za," OR REPLACE",6,0):substr_replace($Za," IF NOT EXISTS",12,0))).";\n\n";}if($R=="CREATE+ALTER"&&!$_c){$H="SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = ".q($S)." ORDER BY ORDINAL_POSITION";echo"DELIMITER ;;
  7. as$X){if($X[1]!="USAGE")$gc["$B[2]$X[2]"][$X[1]]=true;if(ereg(' WITH GRANT OPTION',$K[0]))$gc["$B[2]$X[2]"]["GRANT OPTION"]=true;}}if(preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~",$K[0],$B))$pd=$B[1];}}if($_POST&&!$j){$qd=(isset($_GET["host"])?q($fa)."@".q($_GET["host"]):"''");$jd=q($_POST["user"])."@".q($_POST["host"]);$Qd=q($_POST["pass"]);if($_POST["drop"])query_redirect("DROP USER $qd",ME."privileges=",'User has been dropped.');else{$bb=false;if($qd!=$jd){$bb=queries(($f->server_info<5?"GRANT USAGE ON *.* TO":"CREATE USER")." $jd IDENTIFIED BY".($_POST["hashed"]?" PASSWORD":"")." $Qd");$j=!$bb;}elseif($_POST["pass"]!=$pd||!$_POST["hashed"])queries("SET PASSWORD FOR $jd = ".($_POST["hashed"]?$Qd:"PASSWORD($Qd)"));if(!$j){$te=array();foreach($id
  8. as$md=>$r){if(isset($_GET["grant"]))$r=array_filter($r);$r=array_keys($r);if(isset($_GET["grant"]))$te=array_diff(array_keys(array_filter($id[$md],'strlen')),$r);elseif($qd==$jd){$od=array_keys((array)$gc[$md]);$te=array_diff($od,$r);$r=array_diff($r,$od);unset($gc[$md]);}if(preg_match('~^(.+)\\s*(\\(.*\\))?$~U',$md,$B)&&(!grant("REVOKE",$te,$B[2]," ON $B[1] FROM $jd")||!grant("GRANT",$r,$B[2]," ON $B[1] TO $jd"))){$j=true;break;}}}if(!$j&&isset($_GET["host"])){if($qd!=$jd)queries("DROP USER $qd");elseif(!isset($_GET["grant"])){foreach($gc
  9. as$md=>$te){if(preg_match('~^(.+)(\\(.*\\))?$~U',$md,$B))grant("REVOKE",array_keys($te),$B[2]," ON $B[1] FROM $jd");}}}queries_redirect(ME."privileges=",(isset($_GET["host"])?'User has been altered.':'User has been created.'),!$j);if($bb)$f->query("DROP USER $jd");}}page_header((isset($_GET["host"])?'Username'.": ".h("$fa@$_GET[host]"):'Create user'),$j,array("privileges"=>array('','Privileges')));if($_POST){$K=$_POST;$gc=$id;}else{$K=$_GET+array("host"=>$f->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"));$K["pass"]=$pd;if($pd!="")$K["hashed"]=true;$gc[(DB!=""&&!isset($_GET["host"])?idf_escape(addcslashes(DB,"%_")):"").".*"]=array();}echo'<form action="" method="post">
  10. <table cellspacing="0">
  11. <table cellspacing="0" onclick="tableClick(event);" class="nowrap checkable">
  12. ';$s=-1;foreach(process_list()as$s=>$K){if(!$s)echo"<thead><tr lang='en'>".(support("kill")?"<th>&nbsp;":"")."<th>".implode("<th>",array_keys($K))."</thead>\n";echo"<tr".odd().">".(support("kill")?"<td>".checkbox("kill[]",$K["Id"],0):"");foreach($K
  13. as$y=>$X){if(in_array(idf_escape($y),$N))unset($Df[$y]);}if($_POST["export"]){cookie("adminer_import","output=".urlencode($_POST["output"])."&format=".urlencode($_POST["format"]));dump_headers($a);$b->dumpTable($a,"");if(!is_array($_POST["check"])||$Df===array()){$Pf=$Z;if(is_array($_POST["check"]))$Pf[]="($Qf)";$H="SELECT $ec".($Pf?"\nWHERE ".implode(" AND ",$Pf):"").$ic;}else{$_f=array();foreach($_POST["check"]as$X)$_f[]="(SELECT".limit($ec,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X).$ic,1).")";$H=implode(" UNION ALL ",$_f);}$b->dumpData($a,"table",$H);exit;}if(!$b->selectEmailProcess($Z,$n)){if($_POST["save"]||$_POST["delete"]){$I=true;$ma=0;$H=table($a);$P=array();if(!$_POST["delete"]){foreach($e
  14. as$D=>$X){$X=process_input($l[$D]);if($X!==null){if($_POST["clone"])$P[idf_escape($D)]=($X!==false?$X:idf_escape($D));elseif($X!==false)$P[]=idf_escape($D)." = $X";}}$H.=($_POST["clone"]?" (".implode(", ",array_keys($P)).")\nSELECT ".implode(", ",$P)."\nFROM ".table($a):" SET\n".implode(",\n",$P));}if($_POST["delete"]||$P){$Oa="UPDATE";if($_POST["delete"]){$Oa="DELETE";$H="FROM $H";}if($_POST["clone"]){$Oa="INSERT";$H="INTO $H";}if($_POST["all"]||($Df===array()&&$_POST["check"])||count($hc)<count($N)){$I=queries($Oa." $H".($_POST["all"]?($Z?"\nWHERE ".implode(" AND ",$Z):""):"\nWHERE $Qf"));$ma=$f->affected_rows;}else{foreach((array)$_POST["check"]as$X){$I=queries($Oa.limit1($H,"\nWHERE ".where_check($X)));if(!$I)break;$ma+=$f->affected_rows;}}}queries_redirect(remove_from_uri("page"),lang(array('%d item has been affected.','%d items have been affected.'),$ma),$I);}elseif(!$_POST["import"]){if(!$_POST["val"])$j='Double click on a value to modify it.';else{$I=true;$ma=0;foreach($_POST["val"]as$Bf=>$K){$P=array();foreach($K
  15. as$y=>$X){$y=bracket_escape($y,1);$P[]=idf_escape($y)." = ".(ereg('char|text',$l[$y]["type"])||$X!=""?$b->processInput($l[$y],$X):"NULL");}$H=table($a)." SET ".implode(", ",$P);$Pf=" WHERE ".where_check($Bf).($Z?" AND ".implode(" AND ",$Z):"");$I=queries("UPDATE".(count($hc)<count($N)?" $H$Pf":limit1($H,$Pf)));if(!$I)break;$ma+=$f->affected_rows;}queries_redirect(remove_from_uri(),lang(array('%d item has been affected.','%d items have been affected.'),$ma),$I);}}elseif(is_string($Ub=get_file("csv_file",true))){cookie("adminer_import","output=".urlencode($la["output"])."&format=".urlencode($_POST["separator"]));$I=true;$Ma=array_keys($l);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$Ub,$Rc);$ma=count($Rc[0]);begin();$Ee=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($Rc[0]as$y=>$X){preg_match_all("~((\"[^\"]*\")+|[^$Ee]*)$Ee~",$X.$Ee,$Sc);if(!$y&&!array_diff($Sc[1],$Ma)){$Ma=$Sc[1];$ma--;}else{$P=array();foreach($Sc[1]as$s=>$Ja)$P[idf_escape($Ma[$s])]=($Ja==""&&$l[$Ma[$s]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ja))));$I=insert_update($a,$P,$ae);if(!$I)break;}}if($I)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(array('%d row has been imported.','%d rows have been imported.'),$ma),$I);queries("ROLLBACK");}else$j=upload_error($Ub);}}$Xe=$b->tableName($T);page_header('Select'.": $Xe",$j);session_write_close();$P=null;if(isset($ue["insert"])){$P="";foreach((array)$_GET["where"]as$X){if(count($n[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!ereg('[_%]',$X["val"]))))$P.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($T,$P);if(!$e)echo"<p class='error'>".'Unable to select the table'.($l?".":": ".error())."\n";else{echo"<form action='' id='form'>\n","<div style='display: none;'>";hidden_fields_get();echo(DB!=""?'<input type="hidden" name="db" value="'.h(DB).'">'.(isset($_GET["ns"])?'<input type="hidden" name="ns" value="'.h($_GET["ns"]).'">':""):"");echo'<input type="hidden" name="select" value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($N,$e);$b->selectSearchPrint($Z,$e,$v);$b->selectOrderPrint($zd,$e,$v);$b->selectLimitPrint($z);$b->selectLengthPrint($hf);$b->selectActionPrint($v);echo"</form>\n";$E=$_GET["page"];if($E=="last"){$cc=$f->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$E=floor(max(0,$cc-1)/$z);}$H="SELECT".limit((+$z&&$hc&&count($hc)<count($N)&&$x=="sql"?"SQL_CALC_FOUND_ROWS ":"").$ec,($Z?"\nWHERE ".implode(" AND ",$Z):"").$ic,($z!=""?+$z:null),($E?$z*$E:0),"\n");echo$b->selectQuery($H);$I=$f->query($H);if(!$I)echo"<p class='error'>".error()."\n";else{if($x=="mssql")$I->seek($z*$E);$_b=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$L=array();while($K=$I->fetch_assoc()){if($E&&$x=="oracle")unset($K["RNUM"]);$L[]=$K;}if($_GET["page"]!="last")$cc=(+$z&&$hc&&count($hc)<count($N)?($x=="sql"?$f->result(" SELECT FOUND_ROWS()"):$f->result("SELECT COUNT(*) FROM ($H) x")):count($L));if(!$L)echo"<p class='message'>".'No rows.'."\n";else{$ya=$b->backwardKeys($a,$Xe);echo"<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$hc&&$N?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".'edit'."</a>");$hd=array();$q=array();reset($N);$je=1;foreach($L[0]as$y=>$X){if($T["Oid"]!="t"||$y!="oid"){$X=$_GET["columns"][key($N)];$k=$l[$N?($X?$X["col"]:current($N)):$y];$D=($k?$b->fieldName($k,$je):"*");if($D!=""){$je++;$hd[$y]=$D;$Na=idf_escape($y);$oc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($y);echo'<th><a href="'.h($oc).'">'.(!$N||$X?apply_sql_function($X["fun"],$D):h(current($N)))."</a>";echo"<a href='".h("$oc&desc%5B0%5D=1")."' title='".'descending'."' class='text'> ↓</a>";}$q[$y]=$X["fun"];next($N);}}$Mc=array();if($_GET["modify"]){foreach($L
  16. as$K){foreach($K


Back to Top