[UPHPU] Multiple Query Statements
sean at exit12.org
Fri Sep 10 14:17:23 MDT 2010
If you have access to the MySQLi (MySQL Improved) plugin then you can use
On Fri, Sep 10, 2010 at 1:59 PM, Michael Jones <jmjones at sisna.com> wrote:
> We have an application that I'm converting to PHP. There are several places
> that do something like this:
> $query = "START TRANSACTION;"
> $query+= "INSERT INTO a (.....)"
> $query+= "INSERT INTO b (...)"
> $query+= "SELECT LAST_INSERT_ID() as ID"
> $query+= "COMMIT"
> Since mysql_query doesn't support multiple queries per statement, what is
> the best way to do this in PHP? Right now I'm using a transaction class to
> put each query in an array and loop them, but efficiently handling any
> return results is a bit of a puzzle.
> Any ideas?
> Sent from my iPhone
> UPHPU mailing list
> UPHPU at uphpu.org
> IRC: #uphpu on irc.freenode.net
More information about the UPHPU