SQL, PHP: want to get the collums of a table INFORMATION_SCHEMA gives acces denied --> alternative?

Posted by matthy on Stack Overflow See other posts from Stack Overflow or by matthy
Published on 2010-04-26T21:26:34Z Indexed on 2010/04/26 21:33 UTC
Read the original article Hit count: 332

hi

what i am trying to do is get all the collums of a table (the table can be empty)

example of what i did before:

SELECT COLUMN_NAME FROM
INFORMATION_SCHEMA.COLUMNS 
WHERE table_name = 'aTable' 
AND table_schema = 'theDatabase'

it works perfectly on localhost however on my provider it gives:

#1142 - SELECT command denied to user 'username'@'localhost' for table 'COLUMNS'

is there an alternative that doesn't use the INFORMATION_SCHEMA??

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql