Re: Last record
| From: | César L . Aracena | Date: | Mon, 03 Jun 2002 16:45:30 +0000 |
| Subject: | Re: Last record | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19585@lists.php.net to get a copy of this message | ||
You can solve that just by asking for the insert_id that was made. Just
place the following lines after the mysql_query:
$id = mysql_insert_id();
$message = "Record Added (id = $id)";
and you'r done!
Cesar Aracena
caracena@infovia.com.ar
Neuquen, Argentina
----- Original Message -----
From: "Antonio Bernabei" <tonibern@tin.it>
To: "César L. Aracena" <caracena@infovia.com.ar>; "PHP DB List"
<php-db@lists.php.net>
Sent: Monday, June 03, 2002 5:14 AM
Subject: [PHP-DB] Last record
> If I have just inserted one set of values with mysql_query(INSERT ...) how
> can I get the values just inserted (I needed to get an autoincrement value
> out of the table)
> Thanks
> Antonio Bernabei
> ----- Original Message -----
> > From: "César L. Aracena" <caracena@infovia.com.ar>
> > To: "PHP DB List" <php-db@lists.php.net>
> > Sent: Monday, June 03, 2002 9:05 AM
> > Subject: [PHP-DB] Strange need
> >
> >
> > Hi all,
> >
> > I know this is not used a lot, but I'm building a site that will show up
a
> > some kinda strange content. It will have diferent tables inside diferent
> > pages. Each table will show a diferent header with several colums
showing
> > diferent diameters of the products. The table header will not be created
> by
> > PHP, so the colums diameters will not be handled or recordered using
> > variables.
> >
> > The rows on the other hand, will show diferent products which will be
> > obtained by PHP from a MySQL database. each product has several
diameters
> > and I need PHP to put a check sign (image made) under ceratin diameter
> > colums for each product.
> >
> > The tables under I have that information are a products table, a
diameters
> > table and a relationship of 1:N table for the products - diameters. Can
I
> > make a PHP function that will recognize the HTML column content and
> compare
> > it to the information collected from the DB relationships table, so it
> will
> > know when to put a check sign in the column for that product?
> >
> > Thanks a lot on this one,
> >
> > Cesar Aracena
> > caracena@infovia.com.ar
> > Neuquen, Argentina
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>