How can I get columns name from select query in php?

Posted by Farshad Mehrvarzan on Stack Overflow See other posts from Stack Overflow or by Farshad Mehrvarzan
Published on 2012-07-07T22:02:29Z Indexed on 2012/07/08 21:16 UTC
Read the original article Hit count: 207

Filed under:
|
|
|

I want to execute a SELECT query but I don't how many columns to select.

Like:

select name, family from persons;

How can I know which columns to select?

"I am currently designing a site for the execute query by users. So when the user executes this query, I won't know which columns selected. But when I want to show the results and draw a table for the user I should know which columns selected."

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql