php - zend framework: wait for query to finish before starting another -


in web app i've created in zend framework, i'm creating new database every new client registers. query of course rather heavy , time consuming since need create database, create 10 tables , put data in tables.

we using 1 large sql file read in , exec().

after queries, mysql connection in zf, need insert new record in 1 of tables have been created in previous step.

this fails: when first query isn't finished yet , try insert data in on of tables being created, error "table xxxx doesn't exist".

all happens in fraction of second, cannot find way "wait" first large query have finished.

putting sleep(2) command before second statement solved problem, that's not way want play.

also, cannot use transaction since using create database , other statements cannot used transactions.

one database per client can of worms want eliminate before gets out of hand. use single database client_id field in each table indicate client record belongs to. (this implies addition of new table hold client records themselves.)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -