Reply to Re: Multiple Statements in a query

Your name:

Reply:


Posted by Dikkie Dik on 03/03/07 18:07

> I have 2 statements that I'd like to string together in a query, but
> according to everything I'm seeing, it's not possible.
> What I'm doing is an insert of a row, where the primary key is an auto
> increment. I want to retrieve that by using LAST_INSERT_ID(). I
> tried sending another query after the first (once I knew that it the
> data was what I need) but it didn't return anything. It seems that
> that function can't be used in separate calls or something. Either
> that or there's a setting that I need to check. Any ideas?

It is already suggested that you post the queries themselves. But it
could be something else: If you issue the queries in separate
connections, they will not work together. A connection in MySQL (I
assume you are using MySQL) is like a session: variables only exist
within that session and the result of LAST_INSERT_ID is also not visible
to other connections.

So you do issue the queries in one connection, I hope?

Best regards

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация