AW: getting data back when inserting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The actual problem was the leading number in some of your arguments
(4_h_1, 4_h_2, etc....)

Stefan

> -----Ursprüngliche Nachricht-----
> Von: Aaron Todd [mailto:aaloki88@xxxxxxxxxxx]
> Gesendet: Mittwoch, 1. Dezember 2004 18:33
> An: php-db@xxxxxxxxxxxxx
> Betreff: Re:  getting data back when inserting
> 
> Thanks a bunch...thats exactly what I was looking for.
> 
> Aaron
> 
> 
> "Stefan" <phpmail@xxxxxxxxxxxx> wrote in message
> news:20041201162942.9BF6690140@xxxxxxxxxxxxxxxxxxxxxxx
> You should easily use
> 
> mysql_insert_id();
> 
> otherwise you could use something like:
> 
> SELECT max(id) FROM ...
> 
> But I think the first command is what you're looking for.
> 
> Stefan
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Aaron Todd [mailto:aaloki88@xxxxxxxxxxx]
> > Gesendet: Mittwoch, 1. Dezember 2004 17:01
> > An: php-db@xxxxxxxxxxxxx
> > Betreff:  getting data back when inserting
> >
> > I was wondering if somone might be able to suggest a command to me...I
> am
> > inserting data into a MySQL database that has an auto-incrementing
> primary
> > field.  When I insert the data I would like to somehow get the value of
> > the
> > auto-incrementing primary field.  I thought I could just run a SELECT
> > statement on some of the data that I am inserting, but the problem is
> that
> > it could have a duplicate already in the database.
> >
> > Anyone know of a command or something to point me in the direction I am
> > looking to go?
> >
> > Thanks,
> >
> > Aaron
> >
> > --
> > 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

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



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux