Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function get_enum_options($table, $column){
- $query = sprintf('SHOW COLUMNS FROM %s LIKE "%s"', $table, $column);
- $result = db_query($query);
- if( mysql_num_rows($result) > 0 ){
- $result = db_fetch_assoc($result);
- $result = str_replace(array('enum(', ')', '\''), '', $result['Type']);
- $result = explode(',', $result);
- } else{
- $result = false;
- }
- return $result;
- }
- ?>
Add Comment
Please, Sign In to add comment