About 20,250 results: "php preg_match_all"
Page 5 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On


  1. 				if (preg_match('/^\s*' . preg_quote($row['column'], '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['constraint'], $match)) {
  2. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  3. 		
  4. 		preg_match_all('#(?<=,|\()\s+(?:"|\`)(\w+)(?:"|\`)\s+(?:([a-z]+)(?:\(([^)]+)\))?( unsigned)?(?: zerofill)?)(?: character set [^ ]+)?(?: collate [^ ]+)?(?: NULL)?( NOT NULL)?(?: DEFAULT ((?:[^, \']*|\'(?:\'\'|[^\']+)*\')))?( auto_increment)?( COMMENT \'(?:\'\'|[^\']+)*\')?( ON UPDATE CURRENT_TIMESTAMP)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  5. 			// Primary keys
  6. 			preg_match_all('/PRIMARY KEY\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  7. 			// Unique keys
  8. 			preg_match_all('/UNIQUE KEY\s+"([^"]+)"\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  9. 			// Foreign keys
  10. 			preg_match_all('#FOREIGN KEY \("([^"]+)"\) REFERENCES "([^"]+)" \("([^"]+)"\)(?:\sON\sDELETE\s(SET\sNULL|SET\sDEFAULT|CASCADE|NO\sACTION|RESTRICT))?(?:\sON\sUPDATE\s(SET\sNULL|SET\sDEFAULT|CASCADE|NO\sACTION|RESTRICT))?#', $row['Create Table'], $matches, PREG_SET_ORDER);
  11. 				if (preg_match('/^\s*' . preg_quote($column, '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['check_constraint'], $match)) {
  12. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  13. 			// Get column level key definitions
  14. 			preg_match_all('#(?<=,|\()\s*["`\[]?(\w+)["`\]]?\s+(?:[a-z]+)(?:\((?:\d+)\))?(?:(?:\s+NOT\s+NULL)|(?:\s+DEFAULT\s+(?:[^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(?:\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))|(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  15. 			// Get table level unique key definitions
  16. 			preg_match_all('#(?<=,|\()\s*UNIQUE\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);

  1. 				if (preg_match('/^\s*' . preg_quote($row['column'], '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['constraint'], $match)) {
  2. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  3. 			// Primary keys
  4. 			preg_match_all('/PRIMARY KEY\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  5. 				if (preg_match('/^\s*' . preg_quote($column, '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['check_constraint'], $match)) {
  6. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  7. 		
  8. 		preg_match_all('#(?<=,|\()\s*(?:`|"|\[)?(\w+)(?:`|"|\])?\s+([a-z]+)(?:\(\s*(\d+)(?:\s*,\s*(\d+))?\s*\))?(?:(\s+NOT\s+NULL)|(?:\s+NULL)|(?:\s+DEFAULT\s+([^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?\w+["`\]]?\s*\(\s*["`\[]?\w+["`\]]?\s*\)\s*(?:\s+(?:ON\s+DELETE|ON\s+UPDATE)\s+(?:CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  9. 			// Get column level key definitions
  10. 			preg_match_all('#(?<=,|\()\s*["`\[]?(\w+)["`\]]?\s+(?:[a-z]+)(?:\((?:\d+)\))?(?:(?:\s+NOT\s+NULL)|(?:\s+DEFAULT\s+(?:[^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(?:\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))|(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  11. 			// Get table level primary key definitions
  12. 			preg_match_all('#(?<=,|\()\s*PRIMARY\s+KEY\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  13. 			// Get table level foreign key definitions
  14. 			preg_match_all('#(?<=,|\()\s*FOREIGN\s+KEY\s*(?:["`\[]?(\w+)["`\]]?|\(\s*["`\[]?(\w+)["`\]]?\s*\))\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))?(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))?(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  15. 			// Get table level unique key definitions
  16. 			preg_match_all('#(?<=,|\()\s*UNIQUE\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);







  1.     // @todo match more details (year, director, actors, image)
  2.     preg_match_all( '#<a href="/film/fichefilm_gen_cfilm=([0-9]+)\.html" class="link1">(.*?)</a>#', $searchPage, $matches, PREG_SET_ORDER );
  3.     preg_match_all( '#&nbsp;\(([^)]+)\)</a>#', $searchPage, $origTitleMatches, PREG_SET_ORDER );
  4.     $substring = substr( $substring, 0, strpos( $substring, '</h3>' ) );
  5.     if ( preg_match_all( '#<a href="(/film/alaffiche_genre_gen_genre[^"]+)" class="link1">([^<]+)</a>#', $substring, $genreMatches, PREG_SET_ORDER ) )
  6.     $substring = substr( $substring, 0, strpos( $substring, '</h3>' ) );
  7.     if ( preg_match_all( '#<a[^>]*href="([^"]+)"[^>]*>(.*?)</a>#', $substring, $matches, PREG_SET_ORDER ) )
  8.         $substring = substr( $substring, 0, strpos( $substring, '</h3>' ) );
  9.         if ( preg_match_all( '#<a[^>]*href="([^"]+)"[^>]*>(.*?)</a>#', $substring, $matches, PREG_SET_ORDER ) )
  10.         // $trailersPage = utf8_encode( file_get_contents( 'http://www.allocine.fr/webtv/acvision.asp?nopub=1&emission=&player=ASF&debit=HD&cvid=' . $videoID ) );
  11.         if ( preg_match_all( '#<a href="(acvision\.asp\?cvid=[0-9]+)" [^>]+>([^<]+)</a>#', $trailersListPage, $trailersMatches, PREG_SET_ORDER ) )
  12.     $substring = substr( $substring, 0, strpos( $substring, '</table' ) );
  13.     if ( preg_match_all( '#<h5><a href="(/personne/fichepersonne_gen_cpersonne=[0-9]+\.html)" class="link1">([^<]+)</a></h5>#', $substring, $actorsMatches, PREG_SET_ORDER ) )
  14.     {
  15.         preg_match_all( '#<h5>([^<]+)</h5>#', $substring, $actorsRolesMatches );

  1. column_foreign_keys($N){global$b;$F=array();foreach($b->foreignKeys($N)as$n){foreach($n["source"]as$W)$F[$W][]=$n;}return$F;}function
  2. enum_input($S,$za,$l,$X,$Ib=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$kd);$F=($Ib!==null?"<label><input type='$S'$za value='$Ib'".((is_array($X)?in_array($Ib,$X):$X===0)?" checked":"")."><i>".lang(4)."</i></label>":"");foreach($kd[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Na=(is_int($X)?$X==$p+1:(is_array($X)?in_array($p+1,$X):$X===$W));$F.=" <label><input type='$S'$za value='".($p+1)."'".($Na?' checked':'').'>'.h($b->editVal($W,$l)).'</label>';}return$F;}function
  3. nbsp($tc[""])."<td>".$b->editInput($_GET["edit"],$l,$za,$X);else{$ic=0;foreach($tc
  4. as$v=>$W){if($v===""||!$W)break;$ic++;}$Md=($ic?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($l["field"])))."]']; if ($ic > f.selectedIndex) f.selectedIndex = $ic;\"":"");$za.=$Md;echo(count($tc)>1?html_select("function[$_]",$tc,$o===null||in_array($o,$tc)||isset($tc[$o])?$o:"","functionChange(this);"):nbsp(reset($tc))).'<td>';$Mc=$b->editInput($_GET["edit"],$l,$za,$X);if($Mc!="")echo$Mc;elseif($l["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$kd);foreach($kd[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Na=(is_int($X)?($X>>$p)&1:in_array($W,explode(",",$X),true));echo" <label><input type='checkbox' name='fields[$_][$p]' value='".(1<<$p)."'".($Na?' checked':'')."$Md>".h($b->editVal($W,$l)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$l["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$_'$Md>";elseif(ereg('text|lob',$l["type"]))echo"<textarea ".($u!="sqlite"||ereg("\n",$X)?"cols='50' rows='12'":"cols='30' rows='1' style='height: 1.2em;'")."$za>".h($X).'</textarea>';else{$qd=(!ereg('int',$l["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$l["length"],$z)?((ereg("binary",$l["type"])?2:1)*$z[1]+($z[3]?1:0)+($z[2]&&!$l["unsigned"]?1:0)):($T[$l["type"]]?$T[$l["type"]]+($l["unsigned"]?0:1):0));echo"<input value='".h($X)."'".($qd?" maxlength='$qd'":"").(ereg('char|binary',$l["type"])&&$qd>20?" size='40'":"")."$za>";}}}function
  5. switch_lang(){global$ca,$Wc;echo"<form action=''>\n<div id='lang'>";hidden_fields($_GET,array('lang'));echo
  6. lang(7).": ".html_select("lang",$Wc,$ca,"var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;")," <input type='submit' value='".lang(8)."' class='hidden'>\n","</div>\n</form>\n";}if(isset($_GET["lang"])){$_COOKIE["adminer_lang"]=$_GET["lang"];$_SESSION["lang"]=$_GET["lang"];}$ca="en";if(isset($Wc[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($Wc[$_SESSION["lang"]]))$ca=$_SESSION["lang"];else{$pa=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$kd,PREG_SET_ORDER);foreach($kd
  7. indexes($N,$h=null){$F=array();foreach(get_rows("SHOW INDEX FROM ".table($N),$h)as$G){$F[$G["Key_name"]]["type"]=($G["Key_name"]=="PRIMARY"?"PRIMARY":($G["Index_type"]=="FULLTEXT"?"FULLTEXT":($G["Non_unique"]?"INDEX":"UNIQUE")));$F[$G["Key_name"]]["columns"][]=$G["Column_name"];$F[$G["Key_name"]]["lengths"][]=$G["Sub_part"];}return$F;}function
  8. foreign_keys($N){global$g,$Ld;static$ne='`(?:[^`]|``)+`';$F=array();$ib=$g->result("SHOW CREATE TABLE ".table($N),1);if($ib){preg_match_all("~CONSTRAINT ($ne) FOREIGN KEY \\(((?:$ne,? ?)+)\\) REFERENCES ($ne)(?:\\.($ne))? \\(((?:$ne,? ?)+)\\)(?: ON DELETE ($Ld))?(?: ON UPDATE ($Ld))?~",$ib,$kd,PREG_SET_ORDER);foreach($kd
  9. as$z){preg_match_all("~$ne~",$z[2],$hf);preg_match_all("~$ne~",$z[5],$Cf);$F[idf_unescape($z[1])]=array("db"=>idf_unescape($z[4]!=""?$z[3]:$z[4]),"table"=>idf_unescape($z[4]!=""?$z[4]:$z[3]),"source"=>array_map('idf_unescape',$hf[0]),"target"=>array_map('idf_unescape',$Cf[0]),"on_delete"=>($z[6]?$z[6]:"RESTRICT"),"on_update"=>($z[7]?$z[7]:"RESTRICT"),);}}return$F;}function
  10. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  11. routine($_,$S){global$g,$Mb,$Lc,$T;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Uf="((".implode("|",array_merge(array_keys($T),$va)).")(?:\\s*\\(((?:[^'\")]*|$Mb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ne="\\s*(".($S=="FUNCTION"?"":$Lc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Uf";$hb=$g->result("SHOW CREATE $S ".idf_escape($_),2);preg_match("~\\(((?:$ne\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$Uf\\s+":"")."(.*)~is",$hb,$z);$m=array();preg_match_all("~$ne\\s*,?~is",$z[1],$kd,PREG_SET_ORDER);foreach($kd
  12. <td><input name="',$v,'[length]" value="',h($l["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$v"."[collation]'".(ereg('(char|text|enum|set)$',$l["type"])?"":" class='hidden'").'><option value="">('.lang(86).')'.optionlist($Ua,$l["collation"]).'</select>',($bg?"<select name='$v"."[unsigned]'".(!$l["type"]||ereg('(int|float|double|decimal)$',$l["type"])?"":" class='hidden'").'><option>'.optionlist($bg,$l["unsigned"]).'</select>':''),($mc?"<select name='$v"."[on_delete]'".(ereg("`",$l["type"])?"":" class='hidden'")."><option value=''>(".lang(87).")".optionlist(explode("|",$Ld),$l["on_delete"])."</select> ":" ");}function
  13. process_length($w){global$Mb;return(preg_match("~^\\s*(?:$Mb)(?:\\s*,\\s*(?:$Mb))*\\s*\$~",$w)&&preg_match_all("~$Mb~",$w,$kd)?implode(",",$kd[0]):preg_replace('~[^0-9,+-]~','',$w));}function
  14. as$_=>$n){echo"<tr title='".h($_)."'>","<th><i>".implode("</i>, <i>",array_map('h',$n["source"]))."</i>","<td><a href='".h($n["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($n["db"]),ME):($n["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($n["ns"]),ME):ME))."table=".urlencode($n["table"])."'>".($n["db"]!=""?"<b>".h($n["db"])."</b>.":"").($n["ns"]!=""?"<b>".h($n["ns"])."</b>.":"").h($n["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$n["target"]))."</i>)","<td>".nbsp($n["on_delete"])."\n","<td>".nbsp($n["on_update"])."\n";if($u!="sqlite")echo'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($_)).'">'.lang(108).'</a>';}echo"</table>\n";}if($u!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(109)."</a>\n";}if(support("trigger")){echo"<h3>".lang(110)."</h3>\n";$Sf=triggers($a);if($Sf){echo"<table cellspacing='0'>\n";foreach($Sf
  15. as$v=>$W)echo"<tr valign='top'><td>$W[0]<td>$W[1]<th>".h($v)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($v))."'>".lang(108)."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(111)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(51),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$yf=array();$zf=array();$_="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$_-".DB]?"$_-".DB:$_)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$kd,PREG_SET_ORDER);foreach($kd

  1. column_foreign_keys($O){global$b;$H=array();foreach($b->foreignKeys($O)as$o){foreach($o["source"]as$W)$H[$W][]=$o;}return$H;}function
  2. enum_input($S,$ya,$m,$X,$Nb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$m["length"],$vd);$H=($Nb!==null?"<label><input type='$S'$ya value='$Nb'".((is_array($X)?in_array($Nb,$X):$X===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($vd[1]as$q=>$W){$W=stripcslashes(str_replace("''","'",$W));$Na=(is_int($X)?$X==$q+1:(is_array($X)?in_array($q+1,$X):$X===$W));$H.=" <label><input type='$S'$ya value='".($q+1)."'".($Na?' checked':'').'>'.h($b->editVal($W,$m)).'</label>';}return$H;}function
  3. nbsp($zc[""])."<td>".$b->editInput($_GET["edit"],$m,$ya,$X);else{$nc=0;foreach($zc
  4. as$w=>$W){if($w===""||!$W)break;$nc++;}$be=($nc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($m["field"])))."]']; if ($nc > f.selectedIndex) f.selectedIndex = $nc;\"":"");$ya.=$be;echo(count($zc)>1?html_select("function[$A]",$zc,$p===null||in_array($p,$zc)||isset($zc[$p])?$p:"","functionChange(this);"):nbsp(reset($zc))).'<td>';$Sc=$b->editInput($_GET["edit"],$m,$ya,$X);if($Sc!="")echo$Sc;elseif($m["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$m["length"],$vd);foreach($vd[1]as$q=>$W){$W=stripcslashes(str_replace("''","'",$W));$Na=(is_int($X)?($X>>$q)&1:in_array($W,explode(",",$X),true));echo" <label><input type='checkbox' name='fields[$A][$q]' value='".(1<<$q)."'".($Na?' checked':'')."$be>".h($b->editVal($W,$m)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$m["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$A'$be>";elseif(($bg=ereg('text|lob',$m["type"]))||ereg("\n",$X)){if($bg&&$v!="sqlite")$ya.=" cols='50' rows='12'";else{$J=min(12,substr_count($X,"\n")+1);$ya.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$ya>".h($X).'</textarea>';}else{$Bd=(!ereg('int',$m["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$m["length"],$_)?((ereg("binary",$m["type"])?2:1)*$_[1]+($_[3]?1:0)+($_[2]&&!$m["unsigned"]?1:0)):($T[$m["type"]]?$T[$m["type"]]+($m["unsigned"]?0:1):0));if($h->server_info>=5.6&&ereg('time',$m["type"]))$Bd+=7;echo"<input".(ereg('int',$m["type"])?" type='number'":"")." value='".h($X)."'".($Bd?" maxlength='$Bd'":"").(ereg('char|binary',$m["type"])&&$Bd>20?" size='40'":"")."$ya>";}}}function
  5. indexes($O,$i=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($O),$i)as$I){$H[$I["Key_name"]]["type"]=($I["Key_name"]=="PRIMARY"?"PRIMARY":($I["Index_type"]=="FULLTEXT"?"FULLTEXT":($I["Non_unique"]?"INDEX":"UNIQUE")));$H[$I["Key_name"]]["columns"][]=$I["Column_name"];$H[$I["Key_name"]]["lengths"][]=$I["Sub_part"];}return$H;}function
  6. foreign_keys($O){global$h,$ae;static$Be='`(?:[^`]|``)+`';$H=array();$ib=$h->result("SHOW CREATE TABLE ".table($O),1);if($ib){preg_match_all("~CONSTRAINT ($Be) FOREIGN KEY \\(((?:$Be,? ?)+)\\) REFERENCES ($Be)(?:\\.($Be))? \\(((?:$Be,? ?)+)\\)(?: ON DELETE ($ae))?(?: ON UPDATE ($ae))?~",$ib,$vd,PREG_SET_ORDER);foreach($vd
  7. as$_){preg_match_all("~$Be~",$_[2],$Bf);preg_match_all("~$Be~",$_[5],$Xf);$H[idf_unescape($_[1])]=array("db"=>idf_unescape($_[4]!=""?$_[3]:$_[4]),"table"=>idf_unescape($_[4]!=""?$_[4]:$_[3]),"source"=>array_map('idf_unescape',$Bf[0]),"target"=>array_map('idf_unescape',$Xf[0]),"on_delete"=>($_[6]?$_[6]:"RESTRICT"),"on_update"=>($_[7]?$_[7]:"RESTRICT"),);}}return$H;}function
  8. view($A){global$h;return
  9. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  10. routine($A,$S){global$h,$Rb,$Rc,$T;$ua=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$wg="((".implode("|",array_merge(array_keys($T),$ua)).")\\b(?:\\s*\\(((?:[^'\")]*|$Rb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$Be="\\s*(".($S=="FUNCTION"?"":$Rc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$wg";$hb=$h->result("SHOW CREATE $S ".idf_escape($A),2);preg_match("~\\(((?:$Be\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$wg\\s+":"")."(.*)~is",$hb,$_);$n=array();preg_match_all("~$Be\\s*,?~is",$_[1],$vd,PREG_SET_ORDER);foreach($vd
  11. as$A=>$o){echo"<tr title='".h($A)."'>","<th><i>".implode("</i>, <i>",array_map('h',$o["source"]))."</i>","<td><a href='".h($o["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($o["db"]),ME):($o["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($o["ns"]),ME):ME))."table=".urlencode($o["table"])."'>".($o["db"]!=""?"<b>".h($o["db"])."</b>.":"").($o["ns"]!=""?"<b>".h($o["ns"])."</b>.":"").h($o["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$o["target"]))."</i>)","<td>".nbsp($o["on_delete"])."\n","<td>".nbsp($o["on_update"])."\n",($v=="sqlite"?"":'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($A)).'">'.'Alter'.'</a>');}echo"</table>\n";}if($v!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.'Add foreign key'."</a>\n";}if(support("trigger")){echo"<h3 id='triggers'>".'Triggers'."</h3>\n";$ug=triggers($a);if($ug){echo"<table cellspacing='0'>\n";foreach($ug
  12. as$w=>$W)echo"<tr valign='top'><td>$W[0]<td>$W[1]<th>".h($w)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($w))."'>".'Alter'."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.'Add trigger'."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header('Database schema',"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Sf=array();$Tf=array();$A="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$A-".DB]?"$A-".DB:$A)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$vd,PREG_SET_ORDER);foreach($vd
  13. </form>
  14. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Pe=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$eb)$Pe[$eb][$I["Privilege"]]=$I["Comment"];}$Pe["Server Admin"]+=$Pe["File access on server"];$Pe["Databases"]["Create routine"]=$Pe["Procedures"]["Create routine"];unset($Pe["Procedures"]["Create routine"]);$Pe["Columns"]=array();foreach(array("Select","Insert","Update","References")as$W)$Pe["Columns"][$W]=$Pe["Tables"][$W];unset($Pe["Server Admin"]["Usage"]);foreach($Pe["Tables"]as$w=>$W)unset($Pe["Databases"][$w]);$Od=array();if($_POST){foreach($_POST["objects"]as$w=>$W)$Od[$W]=(array)$Od[$W]+(array)$_POST["grants"][$w];}$Ac=array();$Xd="";if(isset($_GET["host"])&&($G=$h->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($I=$G->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$I[0],$_)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$_[1],$vd,PREG_SET_ORDER)){foreach($vd
  15. as$A=>$W){$W=process_input($n[$A]);if($W!==null){if($_POST["clone"])$M[idf_escape($A)]=($W!==false?$W:idf_escape($A));elseif($W!==false)$M[]=idf_escape($A)." = $W";}}$F.=($_POST["clone"]?" (".implode(", ",array_keys($M)).")\nSELECT ".implode(", ",$M)."\nFROM ".table($a):" SET\n".implode(",\n",$M));}if($_POST["delete"]||$M){$Wa="UPDATE";if($_POST["delete"]){$Wa="DELETE";$F="FROM $F";}if($_POST["clone"]){$Wa="INSERT";$F="INTO $F";}if($_POST["all"]||($Bg===array()&&$_POST["check"])||$Vc){$G=queries("$Wa $F$Rg");$ra=$h->affected_rows;}else{foreach((array)$_POST["check"]as$W){$G=queries($Wa.limit1($F,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($W,$n)));if(!$G)break;$ra+=$h->affected_rows;}}}$Cd=lang(array('%d item has been affected.','%d items have been affected.'),$ra);if($_POST["clone"]&&$G&&$ra==1){$jd=last_id();if($jd)$Cd=sprintf('Item%s has been inserted.'," $jd");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$Cd,$G);}elseif(!$_POST["import"]){if(!$_POST["val"])$l='Ctrl+click on a value to modify it.';else{$G=true;$ra=0;foreach($_POST["val"]as$_g=>$I){$M=array();foreach($I
  16. as$w=>$W){$w=bracket_escape($w,1);$M[]=idf_escape($w)." = ".(ereg('char|text',$n[$w]["type"])||$W!=""?$b->processInput($n[$w],$W):"NULL");}$F=table($a)." SET ".implode(", ",$M);$Qg=" WHERE ".where_check($_g,$n).($Z?" AND ".implode(" AND ",$Z):"");$G=queries("UPDATE".($Vc?" $F$Qg":limit1($F,$Qg)));if(!$G)break;$ra+=$h->affected_rows;}queries_redirect(remove_from_uri(),lang(array('%d item has been affected.','%d items have been affected.'),$ra),$G);}}elseif(is_string($kc=get_file("csv_file",true))){cookie("adminer_import","output=".urlencode($qa["output"])."&format=".urlencode($_POST["separator"]));$G=true;$Va=array_keys($n);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$kc,$vd);$ra=count($vd[0]);begin();$wf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($vd[0]as$w=>$W){preg_match_all("~((?>\"[^\"]*\")+|[^$wf]*)$wf~",$W.$wf,$wd);if(!$w&&!array_diff($wd[1],$Va)){$Va=$wd[1];$ra--;}else{$M=array();foreach($wd[1]as$q=>$Sa)$M[idf_escape($Va[$q])]=($Sa==""&&$n[$Va[$q]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Sa))));$G=insert_update($a,$M,$Ke);if(!$G)break;}}if($G)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(array('%d row has been imported.','%d rows have been imported.'),$ra),$G);queries("ROLLBACK");}else$l=upload_error($kc);}}$Qf=$b->tableName($P);if(is_ajax())ob_start();page_header('Select'.": $Qf",$l);$M=null;if(isset($jf["insert"])){$M="";foreach((array)$_GET["where"]as$W){if(count($rc[$W["col"]])==1&&($W["op"]=="="||(!$W["op"]&&!ereg('[_%]',$W["val"]))))$M.="&set".urlencode("[".bracket_escape($W["col"])."]")."=".urlencode($W["val"]);}}$b->selectLinks($P,$M);if(!$g)echo"<p class='error'>".'Unable to select the table'.($n?".":": ".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($K,$g);$b->selectSearchPrint($Z,$g,$u);$b->selectOrderPrint($ie,$g,$u);$b->selectLimitPrint($x);$b->selectLengthPrint($cg);$b->selectActionPrint($u);echo"</form>\n";$C=$_GET["page"];if($C=="last"){$uc=$h->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$C=floor(max(0,$uc-1)/$x);}$F=$b->selectQueryBuild($K,$Z,$Bc,$ie,$x,$C);if(!$F)$F="SELECT".limit((+$x&&$Bc&&$Vc&&$v=="sql"?"SQL_CALC_FOUND_ROWS ":"").$wc,($Z?"\nWHERE ".implode(" AND ",$Z):"").$Cc,($x!=""?+$x:null),($C?$x*$C:0),"\n");echo$b->selectQuery($F);$G=$h->query($F);if(!$G)echo"<p class='error'>".error()."\n";else{if($v=="mssql"&&$C)$G->seek($x*$C);$Mb=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$J=array();while($I=$G->fetch_assoc()){if($C&&$v=="oracle")unset($I["RNUM"]);$J[]=$I;}if($_GET["page"]!="last")$uc=(+$x&&$Bc&&$Vc?($v=="sql"?$h->result(" SELECT FOUND_ROWS()"):$h->result("SELECT COUNT(*) FROM ($F) x")):count($J));if(!$J)echo"<p class='message'>".'No rows.'."\n";else{$Ca=$b->backwardKeys($a,$Qf);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Bc&&$K?"":"<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>");$Nd=array();$zc=array();reset($K);$Ve=1;foreach($J[0]as$w=>$W){if($w!=$Ud){$W=$_GET["columns"][key($K)];$m=$n[$K?($W?$W["col"]:current($K)):$w];$A=($m?$b->fieldName($m,$Ve):"*");if($A!=""){$Ve++;$Nd[$w]=$A;$f=idf_escape($w);$Jc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($w);$ub="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($Jc.($ie[0]==$f||$ie[0]==$w||(!$ie&&$Vc&&$Bc[0]==$f)?$ub:'')).'">';echo(!$K||$W?apply_sql_function($W["fun"],$A):h(current($K)))."</a>";echo"<span class='column hidden'>","<a href='".h($Jc.$ub)."' title='".'descending'."' class='text'> ↓</a>";if(!$W["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($w)).'\'); return false;" title="'.'Search'.'" class="text jsonly"> =</a>';echo"</span>";}$zc[$w]=$W["fun"];next($K);}}$pd=array();if($_GET["modify"]){foreach($J








Back to Top