Jump to content

Recommended Posts

Hello, I want to get all field names from a table called `profileInfo_choose` where field names = 1 AND user_id=$user_id

 

How is this done?  Or what is the best way if a single query cannot do the job?

 

Thanks

 

you want the "FIELD NAMES" ?.... based on a condition where you are already using some of the field names?.... no make any sense.... maybe you are trying to get all the rows (values) where the condition is TRUE ?...

 

post your table description  ;)

Link to comment
https://forums.phpfreaks.com/topic/219595-getting-field-names/#findComment-1138578
Share on other sites

user_id | fullName | dob | gender | relationship | looking | hometown |

----------------------------------------------------------------------------------------

    5      |      1      |    1  |      1    |        0          |      0      |        1        |     

 

OK getting down to what I want to accomplish is to get all the field names that = 1 where user_id='5'

Link to comment
https://forums.phpfreaks.com/topic/219595-getting-field-names/#findComment-1138589
Share on other sites

your objective no make sense  :o  ... you should think again about your goal  ... and think based on how SQL works... apparently what you want is select all the records where user_id = 5 and then you can choose to show or not the fields if the value = 1 (the name of the field is irrelevant because you can alter it every time you want (aliasing) ).

Link to comment
https://forums.phpfreaks.com/topic/219595-getting-field-names/#findComment-1138629
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.