Jump to content

Enum is returning the field name, not the value


tibberous

Recommended Posts

...

 

That's not actual code I'm using in my program. I just need to know whats up with enum's so I can fix it - I figured it would be easier to answer if I narrowed down the problem rather than pasting in three pages of code that you still can't run because you still don't have the database.

Link to comment
Share on other sites

i'm sure you'll be happy to get back on topic, so what value does it have as far as phpMyAdmin (or console) is concerned?  and is this the case for all the rows, or just the one that gets returned first?  (not sure if you're just print_r()ing the first returned row as your posted code implies or if that was just for show)

Link to comment
Share on other sites

If mysql_fetch_assoc is false, mysql_num_rows is false, it's stupid to explicitly check. It's also not at all relevant to the question, nor is rewriting my code with error handling.

 

I'm using navicat, it displays the correct value, but I am pretty sure that is because it is fixing it. It is return the field name for all the rows.

 

I think it might be like an html checkbox, where it's value is always the same, but it's checked property changes.

 

And I looked at the doc's. It says I can get the index by refering to the field in 'interger context', but I'm not sure how to do that, and I'd really rather have the value as text.

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.