On Thursday 07 February 2002 23:08, Erik Price wrote:
> I have two questions:
I think the php-db list is more appropriate for these.
> 1. Can anyone tell me whether the following statement is true or false?
> The PHP function mysql_insert_id() differs from the MySQL function
> LAST_INSERT_ID() in that the PHP function returns the last
> auto-incremented value from the current connection, and the MySQL
> function returns the highest current value in a table's AUTO_INCREMENT
IIRC they both serve the same function.
> 2. Secondly, if anyone could answer the following question it would be
> very helpful...
> When updating a foreign key (in-between table for many-to-many
> relationships) using the last auto-incremented value, is it better to
> write several separate SQL queries and store them in the same variable
> for mysql_query(), or is it better to write several separate SQL queries
> and store them in separate variables, and then run separate
> mysql_query() functions against those variables separately?
> In other words, when performing multiple SQL queries simultaneously, is
> it better to give them their own variable (each SQL statement), or can
> you lump them all together?
I don't think MySQL is able to handle multiple queries in one statement. IOW
you would have to perform each separately.
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
When childhood dies, its corpses are called adults.
-- Brian Aldiss
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php