Re: easy question
chad, Thursday, June 13, 2002, 4:59:13 PM, you wrote: ck I am sure this is an easy question but I am not thinking clearly for some ck reason. :^) ck If you set a column to auto_Increment. You do not have to put the ck auto_increment # in the insert statement to get it to be inserted. Mysql ck does this automatically. ck Is there a way to have the timestamp automatically inserted when an ck insert statement is run? The timestamp of the insert statement. If you insert into TIMESTAMP column NULL values, current date and time will be inserted. mysql create table mytime( - mytime timestamp); Query OK, 0 rows affected (0.01 sec) mysql insert into mytime values(NULL); Query OK, 1 row affected (0.01 sec) mysql select * from mytime; ++ | mytime | ++ | 20020613103946 | ++ 1 row in set (0.01 sec) ck thanks for the help, ck chad -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
easy question
Hello, I am sure this is an easy question but I am not thinking clearly for some reason. :^) If you set a column to auto_Increment. You do not have to put the auto_increment # in the insert statement to get it to be inserted. Mysql does this automatically. Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. thanks for the help, chad -- Chad Kellerman - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question
Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. Try now() Hisseine - Original Message - From: chad kellerman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 13, 2002 9:59 AM Subject: easy question Hello, I am sure this is an easy question but I am not thinking clearly for some reason. :^) If you set a column to auto_Increment. You do not have to put the auto_increment # in the insert statement to get it to be inserted. Mysql does this automatically. Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. thanks for the help, chad -- Chad Kellerman - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question
chad kellerman wrote: Hello, I am sure this is an easy question but I am not thinking clearly for some reason. :^) If you set a column to auto_Increment. You do not have to put the auto_increment # in the insert statement to get it to be inserted. Mysql does this automatically. Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. thanks for the help, chad That is what the timestamp type is for. Please read the manual. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question
At 08:59 AM 6/13/2002, you wrote: Hello, I am sure this is an easy question but I am not thinking clearly for some reason. :^) If you set a column to auto_Increment. You do not have to put the auto_increment # in the insert statement to get it to be inserted. Mysql does this automatically. Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. thanks for the help, chad -- Chad Kellerman Chad, The first TimeStamp column gets updated whenever the record is inserted *or* modified so this wont help you if you only want the create date and not the modify date. Additional timestamp columns are not automatically updated. This means you need to insert a value explicitly for the create date as in: insert into mytable values(,create_date) values(, now()); Your create_date column can be a timestamp or datetime column. I prefer datetime because they are formatted properly when doing a select on the table. Mike - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question
Also, if you initialise a TIMESTAMP field with NULL, MySQL puts the current time into it - for the first such field in the record only. (p109 of Paul DuBois book - sorry, www.mysql.com seems to have gone down so I can't get a documentation URL). Alec Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. Try now() Hisseine - Original Message - From: chad kellerman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 13, 2002 9:59 AM Subject: easy question Hello, I am sure this is an easy question but I am not thinking clearly for some reason. :^) If you set a column to auto_Increment. You do not have to put the auto_increment # in the insert statement to get it to be inserted. Mysql does this automatically. Is there a way to have the timestamp automatically inserted when an insert statement is run? The timestamp of the insert statement. thanks for the help, chad -- Chad Kellerman - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question, what is MUL
On Fri, Jul 27, 2001 at 09:29:20PM -0700, Michael Collins wrote: I have a table that shows MUL in the key field column, what does that indicate? That means it's a non-unique key. Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 -- NEW MySQL 3.23.29: up 41 days, processed 328,560,531 queries (90/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: easy question, what is MUL
At 11:08 PM -0700 7/27/01, Jeremy Zawodny wrote: I have a table that shows MUL in the key field column, what does that indicate? That means it's a non-unique key. Thank you, but what does MUL stand for? Multiple keys? I suppose it is a key since I created an index on that field. -- Michael __ ||| Michael Collins ||| ||| Kuwago Web Services ||| mailto:[EMAIL PROTECTED] ||| Seattle, WA, USA ||| http://www.lassodev.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
easy question, what is MUL
I have a table that shows MUL in the key field column, what does that indicate? +--+--+--+-+-++ | Field| Type | Null | Key | Default | Extra | +--+--+--+-+-++ | ID | smallint(5) unsigned | | PRI | NULL| auto_increment | | ModifiedLast | timestamp(14)| YES | | NULL|| | CreationDate | datetime | YES | | NULL|| | FirstName| varchar(64) | YES | | NULL|| | LastName | varchar(64) | YES | MUL | NULL|| | BirthDate| date | YES | | NULL|| | PaidAmount | float(6,2) | YES | | 0.00|| | PaidFlag | tinyint(4) | YES | | 0 || +--+--+--+-+-++ 8 rows in set (0.02 sec) This is how it is defined: CREATE TABLE web ( ID smallint(5) unsigned NOT NULL auto_increment, ModifiedLast timestamp(14) NOT NULL, CreationDate datetime default NULL, FirstName varchar(64) default NULL, LastName varchar(64) default NULL, BirthDate date default NULL, PaidAmount float(6,2) default '0.00', PaidFlag tinyint(4) default '0', PRIMARY KEY (ID), KEY LastName (LastName) ) -- Michael __ ||| Michael Collins ||| ||| Kuwago Web Services ||| mailto:[EMAIL PROTECTED] ||| Seattle, WA, USA ||| http://www.lassodev.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php