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 administrators (the site
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 administration
-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 increment question
Jerry Schwartz wrote:
Being
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 =
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($result);
$query =
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
Subject: RE: [PHP] RE: non-auto increment question
On Thu
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
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;
.
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 auto-increment.
And I want to show the value
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
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
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
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 databases they
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 reproducable test
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 enough
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
: 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
-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED
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.
Stats
===
ID
views
is this possible?
-k
sql, query
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
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
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
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
23 matches
Mail list logo