From: Date: July 24 2004 12:10am Subject: Re: Question about Insert Statement List-Archive: http://lists.mysql.com/win32/15247 Message-Id: <20040723151003.1928266848.randy@novaspace.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Danny, Does DateStarted have a default value or is it timestamp column. Either way= , leave DateStarted out of your column list and leave the trailing comma of= f the value list. Also, even though you probably defined Zip as numeric or = integer, you should probably enclose $leaZip in quotes also in the case an = empty value is rec'd (mySQL handles the data type conversion): INSERT INTO $db_s_leagues (leaName, leaEmail, leaOwner, Address, City,State= , Zip) = VALUES('$leaName','','$leaOwner','$leaAddress','$leaCity','$leaState','$lea= Zip') Randy Clamons Systems Programming Astro-auction.com > ------------Original Message------------ > From: "Danny Willis" > To: > Date: Fri, Jul-23-2004 2:34 PM > Subject: Question about Insert Statement > = > My question/problem I am having is that there may be cases where I do not > have all the fields full. From my experimentation and interpretation of = the > documentation if the fields are full and I end up with a query looking li= ke > this: > INSERT INTO $db_s_leagues (leaName, leaEmail, leaOwner, Address, City, > State, Zip, DateStarted) = > VALUES('$leaName','','$leaOwner','$leaAddress','$leaCity','$leaState',$le= aZi > p,) > = > The query fails due to the "''" and the ",)" > = > Is there a way to work around this issue so I don't have to code up some > funky error checking in my php code to check and adjust for any empty dat= a? > = > Here is the query I am working with: > = > INSERT INTO $db_s_leagues (leaName, leaEmail, leaOwner, Address, City, > State, Zip, DateStarted) = > VALUES('$leaName','$leaEmail','$leaOwner','$leaAddress','$leaCity','$leaS= tat > e',$leaZip,$leaDateStarted) > = > Thanks, > Dan = > = > = > -- = > MySQL Windows Mailing List > For list archives: http://lists.mysql.com/win32 > To unsubscribe: http://lists.mysql.com/win32?unsub=3Drandy@stripped= om > = > =