Re: [PHP-DB] auto_increment

2010-09-08 Thread Adriano Rodrigo Guerreiro Laranjeira
Hello! I didn't use any DROP statements. Do exactly as following: mysql CREATE TABLE stats2 LIKE stats; mysql ALTER TABLE stats2 ADD COLUMN id INT NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id); mysql INSERT INTO stats2 SELECT *, 0 FROM stats ORDER BY The first line copies the structure of

Re: [PHP-DB] auto_increment

2010-09-07 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend! I can't see another way to fix your table without a processing (like a stored procedure, script, etcetera). But I believe there is a workaround, which involves a creation of another table. See this: mysql CREATE TABLE stats2 LIKE stats; mysql ALTER TABLE stats2 ADD COLUMN id INT

Re: [PHP-DB] auto_increment

2010-09-07 Thread Ron Piggott
I am receiving the following error Adriano: SQL query: ALTER TABLE `stats` DROP `visits` CREATE TABLE `stats2` LIKE `stats` ; MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

Re: [PHP-DB] auto_increment

2010-09-07 Thread Kapu
You are missing a semicolon after the first alter statement. Kapu On 7. 9. 2010 18:05, Ron Piggott wrote: I am receiving the following error Adriano: SQL query: ALTER TABLE `stats` DROP `visits` CREATE TABLE `stats2` LIKE `stats` ; MySQL said: Documentation #1064 - You have an error in

RE: [PHP-DB] AUTO_INCREMENT value

2010-09-05 Thread Ron Piggott
I figured it out, the permissions weren't set on the user to allow the command to work. Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] auto_increment

2007-03-11 Thread Bastien Koert
are you dumping the data or you just want to reset? issuing the 'empty table' command in phpmyadmin will do that or you can do ALTER TABLE tbl AUTO_INCREMENT = 100; bastien From: Ron Piggott [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB]

Re: [PHP-DB] auto_increment command

2007-03-11 Thread bedul
u can't - Original Message - From: Ron Piggott [EMAIL PROTECTED] To: PHP DB php-db@lists.php.net Sent: Monday, March 12, 2007 7:52 AM Subject: [PHP-DB] auto_increment command I am not sure if that last e-mail went through or not. I am wondering how to re-set the auto_increment field

Re: [PHP-DB] auto_increment command

2007-03-11 Thread Micah Stevens
Actually you can. As Bastien pointed out: ALTER TABLE tbl AUTO_INCREMENT = 1; This may screw with your indexes though, if you have a primary indexed, or unique indexed row, and you set this to 1, mysql MAY try and insert conflicting values. I've never done this so I have no idea how this is

Re: [PHP-DB] auto_increment

2006-05-01 Thread JupiterHost.Net
Ron Piggott (PHP) wrote: How do I change the auto_increment / auto_index value? Ron Do a query that does what you want. Without knowing the type of DB you're using (and since this is a PHP and Database list not just specific DB list) or any other info, there really isn't much you can

Re: [PHP-DB] auto_increment

2006-05-01 Thread Ron Piggott (PHP)
I am using mySQL On Mon, 2006-05-01 at 13:21 +, replies-lists- [EMAIL PROTECTED] wrote: Original Message Date: Monday, May 01, 2006 09:14:36 AM -0400 From: Ron Piggott (PHP) [EMAIL PROTECTED] Subject: [PHP-DB] auto_increment How do I change the

Re: [PHP-DB] auto_increment

2006-05-01 Thread chris smith
On 5/1/06, Ron Piggott (PHP) [EMAIL PROTECTED] wrote: I am using mySQL .. a google search for mysql reset auto_increment reveals the answer! -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] auto_increment

2006-05-01 Thread JupiterHost.Net
Ron Piggott (PHP) wrote: I am using mySQL In that case, mysql.com woudl have MySQL specific resources since it has nothgin to do with PHP (aside form that is apparently what you're using to interact with MySQL) Please read http://www.catb.org/~esr/faqs/smart-questions.html#forum the

Re: [PHP-DB] auto_increment and INSERT INTO

2006-01-21 Thread David Robley
On Sun, 22 Jan 2006 15:08, Ron Piggott (PHP) wrote: I have various tables where a column is set to auto_increment in my table structure. I have been using the following INSERT query format: INSERT INTO table VALUES ('$auto_increment_variable','$variable_1', '$variable_2') and then in

Re: [PHP-DB] auto_increment and INSERT INTO

2006-01-21 Thread Ron Piggott (PHP)
That is the function I was looking for. Thanks. Ron On Sat, 2006-01-21 at 23:47 -0500, [EMAIL PROTECTED] wrote: Try: ?php mysql_query(INSERT INTO table VALUES ('$variable_1', '$variable_2');); $auto_increment_variable = mysql_insert_id(); ? -TG = = = Original message =

Re: [PHP-DB] auto_increment

2004-12-28 Thread ron.php
Thanks Larry. It was mySQL ... Ron On Sun, 26 Dec 2004 20:47:37 -0500, Larry E. Ullman wrote I have the auto_increment on one of my variables. During the past few days I have been doing testing on a live database and created several test records which I now have deleted from my

Re: [PHP-DB] auto_increment

2004-12-26 Thread Larry E . Ullman
I have the auto_increment on one of my variables. During the past few days I have been doing testing on a live database and created several test records which I now have deleted from my table. Is there any way of setting the auto_increment value to match the last correct number? Ron You don't

Re: [PHP-DB] AUTO_INCREMENT problemos

2002-08-27 Thread Adam Williams
Thats how its supposed to work. It won't reuse old numbers even after you delete the entire row. Adam On Tue, 27 Aug 2002, simon wrote: Hi Wondering if anybody can help with this: My table has an INT column named 'member_id' which is set to AUTO_INCREMENT. It

Re: [PHP-DB] AUTO_INCREMENT problemos

2002-08-27 Thread DL Neil
Hi simon My table has an INT column named 'member_id' which is set to AUTO_INCREMENT. It works very well but I have inserted and deleted some test rows during the development stage and now my incremented numbers have jumped ahead. The deleted rows (their member_id values) have not been

Re: [PHP-DB] AUTO_INCREMENT problemos

2002-08-27 Thread Miles Thompson
Checl your MySQL docs and redefine the table if necessary: table type of ISAM - autoincrement numbers get reused table type of MyISAM - autoincrement numbers are not reused. Many people prefer the latter and use the values as primary and foreign keys. Miles Thompson At 05:21 PM 8/27/2002

RE: [PHP-DB] auto_increment problem???

2002-08-26 Thread Miles Thompson
: Ross Gerring Subject: Re: [PHP-DB] auto_increment problem??? Russ, Check your docs to confirm this, as you are probably running a later version than I'm familiar with. If the table is defined as type MyISAM the autoincrement numbers do not get reused, they steadily increase. You can rely on them

RE: [PHP-DB] auto_increment problem???

2002-08-25 Thread Russ
)?? Thanks a lot for your help. :-) -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 24, 2002 12:12 AM To: Russ; [EMAIL PROTECTED] Cc: Ross Gerring Subject: Re: [PHP-DB] auto_increment problem??? Russ, Check your docs to confirm this, as you

Re: [PHP-DB] Auto_increment field size (was: Howto make a double LEFT JOIN)

2001-10-05 Thread Sheridan Saint-Michel
- Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Sheridan Saint-Michel [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, October 05, 2001 9:50 AM Subject: Re: [PHP-DB] Howto make a double LEFT JOIN snip ACK! Don't do this. You do know that an unsigned int (using a signed

RE: [PHP-DB] Auto_Increment

2001-03-29 Thread Boaz Yahav
The correct question is if it's even possible to use a non integer field with auto_increment with MySQL (assuming it's MySQL) and the answer is : No. you must use an int type. From the MySQL manual : "An integer column may have the additional attribute AUTO_INCREMENT. ". Sincerely berber

Re: [PHP-DB] Auto_Increment

2001-03-29 Thread Sean Weissensee
You can use the Serial Datatype if using Postgres. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP-DB] Auto_Increment

2001-03-29 Thread Johannes Janson
Hi, well usually yuto_increment is used on ID fields. then depending on how many rows your table has tinyint (up to 255; 1k), smallint (up to 65535; 2k) mediumint (up to 16777215; 3k) int (up to 4294967295, 4k). Johannes "Ben Cairns" [EMAIL PROTECTED] schrieb im Newsbeitrag

Re: [PHP-DB] auto_increment in mysql

2001-03-28 Thread Russ Michell
I may be semi-new to this MySQl lark but I'm sure auto_increment starts at 0. Russ #---# "Believe nothing - consider everything" Russ

Re: [PHP-DB] auto_increment in mysql

2001-03-28 Thread Fai
The version you use may be lower than 3.23 because auto_increment sequence number begin at 1 for MySQL version up to 3.23. "Russ Michell" [EMAIL PROTECTED] ? news:[EMAIL PROTECTED]... I may be semi-new to this MySQl lark but I'm sure auto_increment starts at 0. Russ

Re: [PHP-DB] AUTO_INCREMENT

2001-03-04 Thread Andrew Apold
At 12:58 PM 3/4/01 +0100, Joris Kluivers wrote: hi, i have a problem i have a database table created with the statement: CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); I insert records with: INSERT INTO