Hi All,

I am building quite a complex CMS (mysql & php) and am wondering what the best approach to inserting data into multiple tables at once is.

I have about 10 tables i need up update with user data, some of them linked by keys, others not.

I have done quite a bit of searching on the net to see what the best approach is and all i seem to find is the multiple queries option.

Whilst the mysql_return_id seems to be the common answer for getting inserted id values back, I was wondering if there was a multiple table insert statement available as there is with the select query?

If the only option is the mysql_return_id road, is the returned id thread specific or is it literally the last inserted id?

The reason why i ask this is, the site i am building will be capable of many users updating information all the time, so if an insert id comes back from another user on a separate thread, it isn't going to work as i intend.

I do hope i have been clear enough in my question and thank the community in advance for any responses you may be able to offer me.

Kind Regards

BM

hi,

are you writing the site OO?

if so you could look into serialization of the object, ormaybe even just a single function that you pass your parameters into

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.