0

I wanted to execute multiple queries in one. Is there a way to condense a bunch of queries into one big string and then execute it? Thanks in advance.

3
  • 1
    What type of queries are you building? Commented Oct 4, 2010 at 15:49
  • I'm not sure this would make sense. What kind of result set would you get back if your queries look up all different columns in different tables? This would make sense for DML statements, you could just concatenate the query strings and execute, but not queries. Show use the queries in question and maybe we can help rebuild it? Commented Oct 4, 2010 at 15:52
  • Anthony, let's say there was a table full of meta data like Wordpress does it, and instead of executing 8-12 lines of separate sql queries for one table, I wanted to do it in 1 shot. Commented Oct 6, 2010 at 14:35

2 Answers 2

3

Just use mysqli

It is the successor to the mysql functions and also exists in either procedural an object oriented implementation.

It can do multiple querys per one session and even return all different sets after the multi query. for more information read:

multi_query()

Sign up to request clarification or add additional context in comments.

Comments

0

yes it's called a stored procedure - use 'em !!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.