aliento Posted March 1, 2009 Share Posted March 1, 2009 Hi, I need to know if there is any way to know which field names returned from a SELECT query. Here is an example : SELECT * FROM test (this i can know it from mysql_list_fields ) SELECT id,op FROM test ( How i can know here that the fields are the id and the op ?) Is there any way to know the fields returned by the query ? thank you Link to comment https://forums.phpfreaks.com/topic/147408-how-to-know-which-fields-did-the-query-returns/ Share on other sites More sharing options...
HuggieBear Posted March 1, 2009 Share Posted March 1, 2009 I'm not sure I understand what you mean. You know what it's returning because you've specified it in the SQL statement. Incidentally, it's preferable to use "SHOW COLUMNS" syntax rather than mysql_list_fields. Regards Rich Link to comment https://forums.phpfreaks.com/topic/147408-how-to-know-which-fields-did-the-query-returns/#findComment-773770 Share on other sites More sharing options...
fenway Posted March 1, 2009 Share Posted March 1, 2009 Why would you even want to? Link to comment https://forums.phpfreaks.com/topic/147408-how-to-know-which-fields-did-the-query-returns/#findComment-773793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.