I solve the problem the following way (MySQL only)
$q = $dbh->prepare("DESCRIBE tablename");
$q->execute();
$table_fields = $q->fetchAll(PDO::FETCH_COLUMN);
More Related Contents:
- PDO::fetchAll vs. PDO::fetch in a loop
- Is there a way to fetch associative array grouped by the values of a specified column with PDO?
- PDO prepared statement fetch() returning double results
- Insert form in MySQL with PDO [duplicate]
- Undefined index $_POST
- Are PDO prepared statements sufficient to prevent SQL injection?
- Reference — frequently asked questions about PDO
- Getting raw SQL query string from PDO prepared statements
- How do I set ORDER BY params using prepared PDO statement?
- “Invalid parameter number: parameter was not defined” Inserting data
- Having issue with matching rows in the database using PDO
- How can I properly use a PDO object for a parameterized SELECT query
- How do I return integer and numeric columns from MySQL as integers and numerics in PHP?
- pdo – Call to a member function prepare() on a non-object [duplicate]
- PDO with INSERT INTO through prepared statements [closed]
- Are there good tutorials on how to use PDO? [closed]
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- Real escape string and PDO [duplicate]
- How to check if a row exist in the database using PDO?
- PHP PDO vs normal mysql_connect
- Can I create a database using PDO in PHP?
- How to bind parameters to a raw DB query in Laravel that’s used on a model?
- PHP PDO::bindParam() data types.. how does it work?
- PHP PDO and MySQLi [duplicate]
- PDO fetch one column from table into 1-dimensional array
- Using value of a column as index in results using PDO
- Getting a PHP PDO connection from a mysql_connect()?
- Having issue with matching rows in the database
- Checking for an empty result (PHP, PDO, and MySQL) [duplicate]
- PDO and MySQL ‘between’