Re: [PHP-DB] MySQL Date insert

2003-08-14 Thread Budelak
This is how I implemented a similar though not exactly the same problem: $tempdate = gmdate("d-m-Y"); $insertSQL = sprintf("INSERT INTO gennews (newsdate, newsheadline, country, newsfull) VALUES ($tempdate, %s, %s, %s); So, you only have to change the format of the gmdate what you want. Bunmi

Re: [PHP-DB] MySQL Date insert

2003-08-10 Thread John W. Holmes
Budelak wrote: This is how I implemented a similar though not exactly the same problem: $tempdate = gmdate("d-m-Y"); $insertSQL = sprintf("INSERT INTO gennews (newsdate, newsheadline, country, newsfull) VALUES ($tempdate, %s, %s, %s); So, you only have to change the format of the gmdate what y

Re: [PHP-DB] MySQL Date insert

2003-07-28 Thread Andrew D. Luebke
John, thanks, now I feel stupid, it's always the silly little things that get you. You were right, when I added the date to the existing insert I forgot to put the ending parentheses back in. Thanks for the help. Andrew. At 11:26 AM 7/28/2003, CPT John W. Holmes wrote: From: "Andrew D. Luebke

Re: [PHP-DB] MySQL Date insert

2003-07-28 Thread CPT John W. Holmes
From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> > I actually think I know part of this answer... I don't think you > need to define a variable to insert into your "date" field. Inserting an > empty value into this filed will populate the field in the database with the > current time, which it a

Re: [PHP-DB] MySQL Date insert

2003-07-28 Thread michele.petrovsky
Andrew, try this: $date = date('Y m d H i s'); A similar syntax (with single quotes rather than double, and without intervening dashes) has worked for me in some MySQL-related PHP code I've just written. My code looked like this: $title2 = "\n".date('l F d Y')."\n"; Michele Petrovsky

Re: [PHP-DB] MySQL Date insert

2003-07-28 Thread jeffrey_n_Dyke
i have a feeling oyu're not getting a mysql error but a PHP error??? you have an odd number of parentheses and mysql_error will not have an closing paren. if that is the case, try this mysql_query("INSERT INTO Boats (Make, Model, Serial,Stock, Extension, Cust_Name, Store, Date) VALUES ('$mak

RE: [PHP-DB] MySQL Date insert

2003-07-28 Thread NIPP, SCOTT V (SBCSI)
u are trying to do here. Try changing the field name and give that a shot. I think I am actually right here though. Scott -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 1:19 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] MySQL Date inse

Re: [PHP-DB] MySQL Date insert

2003-07-28 Thread CPT John W. Holmes
From: "Andrew D. Luebke" <[EMAIL PROTECTED]> > $date = date("Y-m-d H:i:s"); > $result = mysql_query("INSERT INTO Boats (Make, Model, Serial, > Stock, Extension, Cust_Name, Store, Date) VALUES > ('$make', '$model', '$serial', '$stock', '$extension', > '$name', '$st

RE: [PHP-DB] MySQL Date insert

2003-07-28 Thread Andrew D. Luebke
Nope, changed the insert to: $result = mysql_query("INSERT INTO Boats (Make, Model, Serial, Stock, Extension, Cust_Name, Store, Insert_Date) VALUES ('$make', '$model', '$serial', '$stock', '$extension', '$name', '$store', '$date'") or die("Invalid query: "

RE: [PHP-DB] MySQL Date insert

2003-07-28 Thread Hutchins, Richard
Don't know about your date format, but you have named your table column DATE which is a reserved keyword in MySQL. Try naming that something different and see if you still get the error. > -Original Message- > From: Andrew D. Luebke [mailto:[EMAIL PROTECTED] > Sent: Monday, July 28, 2003 2