Ok, my problem was that i have to execute query to multiple mysql server, The easy way to do that to make connection to each of those servers and send query. And i work with php. In some part of my project i need to do hundreds of query at a time and normally php don't support multiple query to database. To do that i have to change some (.h) file in server what i don't have access. I't take lots more time to execute query cos every time send a query to the remote serve the php wait for the result and then send the next query. but if i can send all the query once then it will take less time. I saw searching net for that and couldn't find a better way. Then i thought to do it by my my salfe. And i thought to make a PROCEDURE where i will send all the query with some delimiter. And i coded the below PROCEDURE CREATE PROCEDURE `execute_query`(var_complexe_query LONGTEXT,var_query_delimiter VARCHAR(20)) BEGIN SET @new_string := var_complexe_query; SET @execute_query:=
Today i have to solve a problem in MySql , The problem is i have two table in openCart 1. category_description category_id language name 1 1 category 1 2 1 category 2 3 1 category 3 4 1 category 4 5 1 category 5 6 1 category 6 7 1 category 7 8 1 category 8 1. product_category produc_id category_id 1 1 1 2 1 5 2 1 2 3 2 4 3 2 3 6 The resulting data should be like that produc_id category_name 1 category 1,category 2,category 5 2 category 1,category 3,category 4 3 category 2,category 6 I can do tha by in php by taking the category name to it's respective product id and implode them , but it will take much time and processor power cos the i have to do query every product id separately, I was searching the right query in MySql and found the function GROUP_CONCAT() http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function