Is there a way in which I can extract information from one of my Table Manager tables so that I can reformat the output?
I have information in a table which I wish to extract that data and display it differently. I have been trying to extract the information manually with the following (very basic) sql command:
$sql = db_fetch_object(db_query('SELECT * FROM tablemanager.3;'));
where the table that I am trying to get the information from is table number 3.
However, I get the following error message when i try and view the page:
user warning: SELECT command denied to user 'ndgc_drpl1'@'localhost' for table '3' query: SELECT * FROM tablemanager.3 in /home/ndgc/public_html/testarea/includes/database.mysql.inc on line 172.
Any help would be most appreciated.
Renae.
Comments
Comment #1
dman commentedWhy would you have a . in the tablename?
The error is because you are asking for a table called '3' in a database called 'tablemanager' - which you don't have right to - because it doesn't exist.
Comment #2
pobster commentedI'm not even going to attempt to answer your question as you obviously won't listen to a word I'll say going by the code you're trying to use... I'm not a php programmer either - hell I've never even been a programmer, I've never read a book on it, been to a class on it - yet, I've been able to write probably close on 30 modules/ module upgrades just by looking at other peoples module code and reading through the php snippets page in the handbook. No-one is Richard Pryor in Superman 3, no-one has the ability to just type stuff into a computer without any idea of what they're doing... It just doesn't work like that... You need to at least absorb a little knowledge first - don't run before you can walk... No-one is above a little learning. The query you're asking about would take you less than TWO seconds to look up if you just took the time to open the tablemanager.module file and search for an instance of where I've done the same thing.
I've marked this as a duplicate because you've not told me what you're trying to achieve (which if it's simple table displaying changes is done using css not by writing code) and there's already a thread about how to output a table as a regular array here; http://drupal.org/node/267406
Pobster