PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 22nd, 1999, 12:44 PM
aweigert
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi I'm trying to write to a database that contains a DATE data type... I used

$date = GETDATE();
$curDate = $date["year"] + "-" + $date["month"] + "-" + $date["mday"];
$result = MYSQL_QUERY("SELECT * FROM dbStats WHERE DBName = '$ELMDb' AND Date = '$curDate'");

it does not work right same when I try to reinsert values... for that date... I'm trying to update the Add and Delete count for that date for that db name...

$result = MYSQL_QUERY("INSERT INTO dbStats VALUES('$ELMDb', $curDate, $dbAdd, $dbDelete)");

any suggestions... thanks in advance
Adam...

------------------
Q: What kind of person is worth becoming?
A: The person you are now.

Reply With Quote
  #2  
Old December 23rd, 1999, 04:42 AM
PAV
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You can also try it with the various datefunctions of MySQL, for example use NOW() for the current date:
e.g. insert into TABLE where date=NOW()
So you don't have to make difficult concatenations in PHP. If you only make a slight mistake, MySQL refuses to fulfill your command, without any warning.

Regards, Peter

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > DATE data type for MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT