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 ta
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 your
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
'C
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 IN
I am wondering if something like the following will work in mySQL:
ALTER TABLE `stats` ADD `visits` INT( 25 ) NOT NULL AUTO_INCREMENT PRIMARY
KEY FIRST ORDER BY `initial_access` ASC
This particular syntax won't work though.
initial_access is a column that contains a unix timestamp.
I am trying
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
Does anyone see anything wrong with the $query syntax? Ron
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="ALTER TABLE sessions auto_increment = '1'";
mysql_query($query);
mysql_close();
no idea how
this is handled by the server, but I suspect you'll just get an error.
-Micah
On 03/11/2007 06:55 PM, bedul wrote:
u can't
- Original Message -
From: "Ron Piggott" <[EMAIL PROTECTED]>
To: "PHP DB"
Sent: Monday, March 12, 2007 7:52 AM
Su
u can't
- Original Message -
From: "Ron Piggott" <[EMAIL PROTECTED]>
To: "PHP DB"
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
I am not sure if that last e-mail went through or not. I am wondering
how to re-set the auto_increment field back to 1 in one of my tables.
Ron
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
Subject: [PHP-DB] aut
How do I reset the auto_increment value to 1 in table abc? Ron
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 ent
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: http://www.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: [
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 g
How do I change the auto_increment / auto_index value? Ron
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
That is the function I was looking for. Thanks. Ron
On Sat, 2006-01-21 at 23:47 -0500, [EMAIL PROTECTED] wrote:
> Try:
>
>mysql_query("INSERT INTO table VALUES ('$variable_1', '$variable_2');");
> $auto_increment_variable = mysql_insert_id();
> ?>
>
>
> -TG
>
>
>
>
> = = = Original
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
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 applications where I have needed to know the value of the
$aut
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
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 do
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
--
PHP
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 +0200
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 fo
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.
> I
Hi
Wondering if anybody can help with this:
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
--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 are pro
e is empty)??
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,
Hello,
> you can always reset the auto_increment value (I think that is as simlple
as
> "set insert_id=1;" but you may want to double check as this is off the top
> of my head).
I don't think i can do so cause i never delete all rows.
so will get something like:
1
<- new insert her
1000
100
- 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
> > ACK! Don't do this. You do know that an unsigned int (using a
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
3AC2FA65@tech-01">
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]
ENT. ".
Sincerely
berber
Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.
-Original Message-
From: Ben Cairns [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 12:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Auto_Increment
What is the best f
What is the best field type to use for an Auto_Increment field?
i am using int at the moment, is there a better one?
-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com
"MAKING sense of
the INFORMAT
> I use MySQL 3.22.23 but I just had a hunt about on the web and I found
> a posting that confirmed your findings - I.E: auto_increment starts at
> 1!!
>
> I stand corrected!
The reasoning behind this a colleague of mine recently informed me of..
When an insert occurs, the new record is given th
I use MySQL 3.22.23 but I just had a hunt about on the web and I found
a posting that confirmed your findings - I.E: auto_increment starts at
1!!
I stand corrected!
Russ
#---#
"Believe nothing - con
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
>
> #---
I may be semi-new to this MySQl lark but I'm sure auto_increment starts
at 0.
Russ
#---#
"Believe nothing - consider everything"
Russ
In mysql, the auto_increment start at 1 default,
But, how can I make the auto_increment start at 0?
--
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
id (id);
mvh
Knut
> -Opprinnelig melding-
> Fra: Joris Kluivers [mailto:[EMAIL PROTECTED]]
> Sendt: 4. mars 2001 12:59
> Til: [EMAIL PROTECTED]
> Emne: [PHP-DB] AUTO_INCREMENT
>
>
> hi,
>
> i have a problem
> i have a database table created with the statement:
on 3/4/01 3:58 AM, Joris Kluivers at [EMAIL PROTECTED] wrote:
> CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL
> AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id);
> with php.
> But after some time i get the error:
> ERROR 1062: Duplicate entry '127' for key 1
>
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 c
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 chatmessages (message, username) VALUES ('$message', '$u
44 matches
Mail list logo