Date: 05/12/00
- Next message: Víctor R. Ruiz: "[phplib] Transaction not aborted crash the DB support"
- Previous message: Etienne Sevin: "RE: [phplib] a good tutorial"
- In reply to: Joao Lima: "[phplib] auto-increment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hola:
Joao Lima tecleó:
> The primary key of one of my tables is a whole number (auto-increment).
> Those somebody knows who can I access to the value that I must insert next.
What I have done it's to define a new field called "md5" and store
there a random and known value:
$md5 = md5(random());
$q->query("INSERT INTO TABLE (name, surname, md5) VALUES ('$name', '$surname', '$md5')");
So I can check later the inserted register (well, we need now the
the autoincremental field? ;)
$q->query("SELECT id_table FROM TABLE WHERE md5 = '$md5'");
Greetings,
-----------------------------------------
Víctor R. Ruiz rvr <email protected>
Subdirección de Comunicaciones
Universidad de Las Palmas de Gran Canaria
-----------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Víctor R. Ruiz: "[phplib] Transaction not aborted crash the DB support"
- Previous message: Etienne Sevin: "RE: [phplib] a good tutorial"
- In reply to: Joao Lima: "[phplib] auto-increment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

