Re: [PHP] RE: non-auto increment question

2009-03-11 Thread PJ
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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Gary W. Smith
> 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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
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

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
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($

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
>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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
>-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

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
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

RE: [PHP] RE: non-auto increment question

2009-02-25 Thread Jerry Schwartz
>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

RE: [PHP] RE: non-auto increment question

2009-02-25 Thread Jerry Schwartz
>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

Re: [PHP] RE: non-auto increment question

2009-02-25 Thread PJ
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

RE: non-auto increment question

2009-02-25 Thread Gary W. Smith
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

non-auto increment question

2009-02-25 Thread PJ
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"; $

Re: auto-increment question

2005-01-24 Thread leegold
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

Re: auto-increment question

2005-01-24 Thread leegold
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

Re: auto-increment question

2005-01-24 Thread Gleb Paharenko
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

Re: auto-increment question

2005-01-23 Thread leegold
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]>

auto-increment question

2005-01-22 Thread leegold
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

Re: auto increment question

2003-01-04 Thread Stefan Hinz, iConnect \(Berlin\)
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

Re: auto increment question

2003-01-04 Thread Arthur Fuller
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 > > >

RE: auto increment question

2003-01-03 Thread Adolfo Bello
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 >

RE: auto increment question

2003-01-03 Thread Adolfo Bello
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 >

Re: auto increment question

2003-01-03 Thread Paul DuBois
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

auto increment question

2003-01-03 Thread Kevin
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