473,326 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help needed with saving today's date back to database.

My echo $update_sql statement shows this

UPDATE projects SET dex='{FD35CF46-D1F4-A05F-D4C6-16CF86A2E05F}', Name='h', Designation='f', Phone=59, PMC=1, Quality=1, Progress=1, Issues=1, Responsiveness =1, Commitments=1, Safety=1, SLevel=1, Total=8, Improvement='No comment for now', Future='N', Date=2012/06/21 WHERE dex='{135C2B55-B95D-786D-9CBD-9563B3AF04B3}'

The date shown here is the current date. However, the date stored in my database is 0000-00-00. what could be wrong? I am sanitizing the date as date type.

sanitize($date, "date");

I am using the $date=date(Y/m/d) to get today's date.
Jun 21 '12 #1
1 1546
Rabbit
12,516 Expert Mod 8TB
It depends on the DBMS you're using. But if it's access, dates have to be surrounded by hash (#) symbols. If it's SQL Server, you use single quotes. If it's DB2, I believe you have to use single quotes and cast it to a date. If it's anything else, I don't know off the top of my head. What you have there is the number 2012 divided by 6 divided by 21.
Jun 21 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: martingerber | last post by:
Hi, I have the following script (javascript in html document): <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>Standort Speichern</title>
5
by: Janet Chapman | last post by:
I am creating a database for a video shop and in the loans table want there to be a field for date taken, with a default value of today. Trying to write =today() as in the help gives an error,...
1
by: Jimi Ffondu | last post by:
Hello all - apologies for putting such a banal request for help on a forum as distinguished as this, but I'm in trouble and didn't know where else to turn... It appears I've volunteered to...
2
by: Cy | last post by:
I have a custom access 2000 database, that has contracts with starting and ending dates. What I'd like to be able to do, is key in a date, say today 9/2/05 and get a list of all "current"...
7
by: joeyej | last post by:
How do I compare today's date with this string (in my inc file) so that I can set an alert if date choice i.e. May 15, 2006 not at least greater than two days from current date? <option...
4
by: Kun | last post by:
i have a form which takes in inputs for a mysql query. one of the inputs is 'date'. normally, a user has to manually enter a date, but i am wondering if there is a way to create a button which...
1
by: freekedoutfish | last post by:
Hi. New member here Im sat at work, pounding my head off the desk because this tiny bit of simple code refuses to work. The sub is intended to pull data from the "companyname" column in the...
5
by: M Skabialka | last post by:
I am creating my first Visual Studio project, an inventory database. I have created a form and used written directions to add data from a table to the form using table adapters, data sets, etc. ...
1
by: cptuser | last post by:
Hi, I have a date field on a form. The date in the date field has to be after today's date and not in the past. It also has to be within 30 days from today's date. So if today is 13/04/2007, then...
2
by: susinthaa | last post by:
Hi, we are having some text values in the variable of the VB form and we have to insert these datas into the MS Access database. We have opened the database and only one record is inserted in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.