Jump to content

ENUM fields


k7faq

Recommended Posts

I need to be able to ALTER a table. The problem that I am running into is that the field is in ENUM format.

 

It would be really nice of someone to help point me in a direction that I can read the "ENUM" values from the table and place them into a string. An example of what I have tried is below.

 

The problem that I am running into is that in PHPMyAdmin shows the ENUM values when the Table Structure is viewed. Unfortunately when you run a query, such as "SELECT COUNT( * ) AS `Rows` , `class_location`

FROM `classes` GROUP BY `class_location`" within PHPMyAdmin only two of the three values are displayed and the number of records of each.

 

I need the ability to gather ALL of the Enumerated values in order to create an ALTER table command.

 

Thank you so much for your thoughts.

Steven

 

The following displays the same as PHPMyAdmin

$query = "SELECT `class_location` FROM `classes` GROUP BY `class_location`";

$result=mysql_query($query);

while ($pri=mysql_fetch_array($result))

{

$nowLocations=$nowLocations."'".$pri['class_location']."',";

}

echo $nowLocations;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.