diff --git a/PHP_MySQLI_DropDown_Menu_ENUM.php b/PHP_MySQLI_DropDown_Menu_ENUM.php new file mode 100644 index 0000000..8e158cb --- /dev/null +++ b/PHP_MySQLI_DropDown_Menu_ENUM.php @@ -0,0 +1,38 @@ + + + + HTML; + + if($myDBObject = new mysqli("**SERVER_HOSTNAME**","**MySQL_USERNAME**","**MySQL_PASSWORD**")){ + + $myDBObject->select_db("DB_NAME"); + + if(!$queryResult = $myDBObject->query("SHOW COLUMNS FROM **tableName** WHERE Field=\"**columnName**\"")){ + echo "

There was an error while creating the page.

"; + }else{ + if($queryResult->num_rows == 0){ + echo "

Check the table definition."; + }else{ + echo"

**Title**:

"; + $enumString = $queryResult->fetch_array()['Type']; + $enumString = substr($enumString,6,strlen($enumString)-8); + + $enumString = str_replace('\'','',$enumString); + $arrayEnumOptions = explode(',',$enumString); + echo ""; + echo $HTMLPage; + } + } + + }else{ + echo "

There was an error while creating the page.

"; + } + ?> \ No newline at end of file