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";
$
Oh, myqldump automatically records the current auto-increment when it
dumps in the .sql file...
That explains it...
On Mon, 24 Jan 2005 17:10:11 -0500, "leegold" <[EMAIL PROTECTED]>
said:
>
> On Mon, 24 Jan 2005 12:34:38 +0200, "Gleb Paharenko"
> <[EMAIL PROTECTED]> said:
> > Hello.
> >
> > Not
On Mon, 24 Jan 2005 12:34:38 +0200, "Gleb Paharenko"
<[EMAIL PROTECTED]> said:
> Hello.
>
> Not enough information to make a conclusion. Please, send us information
> about MySQL and operating system versions. Output of "show create table"
> statement on your tables. Could you make a reproducabl
Hello.
Not enough information to make a conclusion. Please, send us information
about MySQL and operating system versions. Output of "show create table"
statement on your tables. Could you make a reproducable test case?
"leegold" <[EMAIL PROTECTED]> wrote:
> I have two different database
Now I'm confused the auto-increment number reverted back to one (1)
after I truncated the tables in one of the DB's. I suppose as long as
the number is unique within the objects I'm making selections,
updates...ect in - who cares.
On Sun, 23 Jan 2005 02:18:33 -0500, "leegold" <[EMAIL PROTECTED]>
I have two different databases they both have an auto-increment PK field
and while they are different databases with different names, they do
have tables with the same names. What I find is that the auto-crement
integer number remembers what it is across these databases. So if I
insert in the 1st D
ROTECTED]>
Sent: Saturday, January 04, 2003 12:28 AM
Subject: auto increment question
> Hello,
>
> I have a table with an ID column and a viewed column. I would like the
> viewed column to increment by one each time the row is updated.
>
> St
sage -
From: "Adolfo Bello" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 7:15 PM
Subject: RE: auto increment question
> It sounds to me that a trigger would help, but mysql doesn't has them
> yet.
>
> Adolfo
>
> >
It sounds to me that a trigger would help, but mysql doesn't has them
yet.
Adolfo
> -Original Message-
> From: Paul DuBois [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 03, 2003 8:04 PM
> To: Kevin; [EMAIL PROTECTED]
> Subject: Re: auto increment question
>
It sounds to me that a trigger would help, but mysql doesn't has them
yet.
Adolfo
> -Original Message-
> From: Paul DuBois [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 03, 2003 8:04 PM
> To: Kevin; [EMAIL PROTECTED]
> Subject: Re: auto increment question
>
At 15:28 -0800 1/3/03, Kevin wrote:
Hello,
I have a table with an ID column and a viewed column. I would like the
viewed column to increment by one each time the row is updated.
Stats
===
ID
views
is this possible?
Sure. Since you're updating the row anyway, set the column value to
one m
Hello,
I have a table with an ID column and a viewed column. I would like the
viewed column to increment by one each time the row is updated.
Stats
===
ID
views
is this possible?
-k
sql, query
-
Before posting, please ch
23 matches
Mail list logo