Jump to content

Display Enum field value from Mysql


allex01

Recommended Posts

Hi,

 

I can't seem to fetch the selected enum value of a specific field.

I i have a field in in mysql table row called options with yes no enum values. In php i want to display the selected value of the enum for the a certain row id. I want to do a simple if statement where if options has enum value yes selected then do so else do something else. Can you please help me with this.

Link to comment
Share on other sites

Below is more info to make things more clear.

In mysql table i have the following 4 fields

title  varchar(50)

desc  varchar(50)

width  int(11)

options enum('Yes', 'No')

 

I can echo out the value of title desc and width by doing the following

<?php echo $row['title'];?>

<?php echo $row['desc'];?>

<?php echo $row['width'];?>

 

But when i do it for option, i do not get anything out. Options is either set to yes or no. It's not echoing out the value of that field

<?php echo $row['options'];?>

 

All i want to do is check if options is set to yes or no.

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.