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
https://forums.phpfreaks.com/topic/90380-display-enum-field-value-from-mysql/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.