Re: [PHP-DB] Related Tables - Capture ID

2003-06-26 Thread Volker Augustin
maybe you could solve this like that:
before querying your db, you should have a $created-variable use
microtime() or whatelse you like.
then you have another uniq 'id' you can ask for the id of the tuple you
added to your table before...

im sure there is another, easier way, maybe with mysql-function
(last-affected-row - i dont know) - but im postgres user :) and do it like i
described before also for other reasons (its fine to have a timestamp...).

volker

- Original Message -
From: "Marie Osypian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 26, 2003 5:43 PM
Subject: [PHP-DB] Related Tables - Capture ID


> Hello,
>
> I have three table in which I am inserting records into in one script.  I
> need to capture the ID of the second tables record insertion to insert
into
> a field into a related table in the third.  What would the easiest way to
go
> about this in php?
>
> Thanks,
>
> MAO
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Related Tables - Capture ID

2003-06-26 Thread Adam Voigt
Do the second query, call the mysql_insert_id function,
and that will give you the id of the row it just inserted.



On Thu, 2003-06-26 at 11:43, Marie Osypian wrote:
> Hello,
> 
> I have three table in which I am inserting records into in one script.  I
> need to capture the ID of the second tables record insertion to insert into
> a field into a related table in the third.  What would the easiest way to go
> about this in php?
> 
> Thanks,
> 
> MAO
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Related Tables - Capture ID

2003-06-26 Thread Marie Osypian
Hello,

I have three table in which I am inserting records into in one script.  I
need to capture the ID of the second tables record insertion to insert into
a field into a related table in the third.  What would the easiest way to go
about this in php?

Thanks,

MAO



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php