var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Assign the variable in show tables.
This is query for find the table in database.
show tables from db_name where tables_in_client='table_name';
i want to store this query into the one variable using procedure and then check using if/else.
if table name is exists return 1 else 0;
kindly help me how can do.
Last edited by vasan; 07-25-13 at 03:32.
Firstly if you are going to return a value then you should use a stored function and not a procedure.
Second thing is that you should look in the database INFORMATION_SCHEMA which includes a table called TABLES. You can query this directly to see if the table exists in a particular database.
To access a database and a table you would need to do something like
SELECT count(*) INTO variable FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbname' AND TABLE_NAME = 'table_name_you_are_searching';
If the table exists it will return 1 because it will have a count of 1 and if it does not exist then it will return 0.