How would you select all the columns from a certain table? I tried "SELECT COLUMNS AS something() FROM table" and "SHOW COLUMNS FROM table" and neither worked!
How do I get all columns from the table in an array?
select columns
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
DESCRIBE `table`You can also do a select from the information_schema database (assuming mysql):
Code: Select all
SELECT column_name FROM COLUMNS WHERE table_schema='database_name' and table_name='table_name'