Ashley Sheridan wrote:
> On Thu, 2009-02-26 at 11:27 -0500, PJ wrote:
>> Jerry Schwartz wrote:
>>
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administr
> Being rather new to all this, I understood from the MySql manual that
> the auto_increment is to b e used immediately after an insertion not
> intermittently. My application is for administrators (the site owner &
> designates) to update the database from and administration directory,
> accessed
Sorry, I should know better.
>-Original Message-
>From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
>Sent: Thursday, February 26, 2009 1:51 PM
>To: Jerry Schwartz
>Cc: 'PJ'; 'Gary W. Smith'; 'MySql'; php-gene...@lists.php.net
>Su
Ashley Sheridan wrote:
> On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote:
>
>>> Here's how I mostly do it (albeit simplified):
>>>
>>> $query = "INSERT INTO `sometable`(`title`,`content`)
>>> VALUES('$title','$content')";
>>> $result = mysql_query($query);
>>> $autoId = mysql_insert_id($
>Here's how I mostly do it (albeit simplified):
>
>$query = "INSERT INTO `sometable`(`title`,`content`)
>VALUES('$title','$content')";
>$result = mysql_query($query);
>$autoId = mysql_insert_id($result);
>
>$query = "INSERT INTO `another_table`(`link_id`,`value`)
>VALUES($autoId,'$value');
>$result
>-Original Message-
>From: PJ [mailto:af.gour...@videotron.ca]
>Sent: Thursday, February 26, 2009 11:27 AM
>To: Jerry Schwartz
>Cc: a...@ashleysheridan.co.uk; 'Gary W. Smith'; 'MySql'; php-
>gene...@lists.php.net
>Subject: Re: [PHP] RE: non-auto i
Jerry Schwartz wrote:
>> Being rather new to all this, I understood from the MySql manual that
>> the auto_increment is to b e used immediately after an insertion not
>> intermittently. My application is for administrators (the site owner &
>> designates) to update the database from and administra
>Being rather new to all this, I understood from the MySql manual that
>the auto_increment is to b e used immediately after an insertion not
>intermittently. My application is for administrators (the site owner &
>designates) to update the database from and administration directory,
>accessed by us
>Being rather new to all this, I understood from the MySql manual that
>the auto_increment is to b e used immediately after an insertion not
>intermittently. My application is for administrators (the site owner &
>designates) to update the database from and administration directory,
>accessed by u
to use autoincrement, you can run into a race
>> condition where two people are inserting at the same time, thus
>> having the same generated id.
>>
>> Hope that helps.
>>
>>
>> ________
>>
>> From: PJ [mailto:af.gour
ing the same generated
id.
Hope that helps.
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Wed 2/25/2009 2:01 PM
To: MySql; php-gene...@lists.php.net
Subject: non-auto increment question
I want to insert a new table entry 1 number higher than the highest in
the field (id). I cannot use au
I want to insert a new table entry 1 number higher than the highest in
the field (id). I cannot use auto-increment.
And I want to show the value of the field to be added in an input field
on the web page:
if (isset($_REQUEST["AddNewBooksRequest"])) {
$SQL = "SELECT MAX(id) FROM book";
$
12 matches
Mail list logo