Link to home
Create AccountLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

look through database for a table that has a column 'message_id'

i am using shared hosting
I have access to database and information schema
I am looking through database for column name 'message_id'

how can I find this column
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Did you try using something like http://www.phpmyadmin.net/home_page/index.php
I have access to database and information schema


do you have access with phpmyadmin or commanline mode? any other tool you use ?
Avatar of rgb192

ASKER

on shared hosting phpmyadmin, I exported information schema and database
and ran export file on wamp creating the database (and maybe information schema)


I am using mysql workbench query editor and have access to both shared hosting and localhost
just one more question,  are you looking for php script to find the column name or in the tools/editor , want to see where is there?
select schema_name, table_name from information_schema.columns where column_name='message_id';
Avatar of rgb192

ASKER

just one more question,  are you looking for php script to find the column name or in the tools/editor , want to see where is there?

tools editor (mysql workbench)



use information_schema
works




>>select schema_name, ost17_ticket from information_schema.columns where column_name='message_id';

Error Code: 1054. Unknown column 'schema_name' in 'field list'
same error response if I
use information_schema
or
use database_name
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of rgb192

ASKER

select table_schema, ost17_ticket from information_schema.columns where column_name='message_id';

error code: 1054 : unknown column 'ost17_ticket' in 'field list'
As I said DO NOT replace table_name with anything.  Of course you do not have a column named ost17_ticket in information_schema.columns.  Run the SQL I gave as is.

Aren't you looking for a table that has a message_id column?  if so, are you trying specify a table name?
Avatar of rgb192

ASKER

correct answer

I just copy paste your code and get result thanks