function get_enum($table,$clname){ $Query="SHOW COLUMNS FROM `$table` LIKE '$clname'"; $result = $this->db->query($Query) or die("Get Enum value Query"); if($result){ $row = mysql_fetch_array( $result , MYSQL_NUM ); $regex = "/'(.*?)'/"; preg_match_all( $regex , $row[1], $enum_array ); $enum_fields = $enum_array[1]; return $enum_fields; } return false; }
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Showing posts with label PHP array. Show all posts
Showing posts with label PHP array. Show all posts
Tuesday, 24 June 2014
How to get Enum Values in Mysql?
Thursday, 10 April 2014
PHP array merging & combine for associative array
Input array= array("test"=>array("s1"=>array(),"s2"=>array())) foreach(array_keys($free_tim) as $k=>$v){ //echo "$v===".count($free_tim[$v])."
"; foreach((array_keys($free_tim[$v])) as $f=>$s){ foreach(($free_tim[$v][$s]) as $g=>$e){ $te[$v][] = $e; } } } Output array = array("test"=>array())
Subscribe to:
Posts (Atom)