Just a little addition...
I use this function to get the id value, given a field name, field data and
table name:
function getId($fname,$data,$tblName) {
GLOBAL $conn;
$query = "SELECT id FROM $tblName WHERE $fname = '$data'";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
$id =
Yap ... this works quite fine with Sybase
Thank you very much ...
> -Original Message-
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 12:27
> To: Walter, Marcel
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] getti
;
<[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: RE: [PHP-DB] getting ID
Is there a similar function for a Sybase - Database ?
> -Original Message-
> From: Ian Grant [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 12:20
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] getting ID
>
> mysql_insert_id([resource link_identifie
mysql_insert_id([resource link_identifier]) returns the value of the
auto_increment field for the previous INSERT query. It will return 0 if
there is not an auto_increment field. If the link_identifier is not
specified, the last opened connection is used.
So, use $id = mysql_insert_id(); directly
I tried this and it gave me an error.
Will this
$id = mysql_insert_id();
allow me to pull out the id?
--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!
"Cynic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 19:19
At 19:19 8/19/2001, CrossWalkCentral wrote the following:
--
>I have a script where I submit user data to the database in my script I need
>to get the id # how can I do this w/o creating a query that does the
>following considering that
I have a script where I submit user data to the database in my script I need
to get the id # how can I do this w/o creating a query that does the
following considering that user could have 10 other entires.
// Request info
$result = mysql_query(
"SELECT * FROM supportsys WHERE email = $email");