Jump to content

Getting field names


liamoco

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

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.