|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
DateTime
<i><b>Originally posted by : Neal (nealio@home.com)</b></i><br />Hello,<br /><br />I am trying to get my database to post a date.<br /><br />It keeps putting zeros in the date time column ie. 0000-00-00 00:00:00<br /><br /><br />I'm using phpmyadmin for the database. Do I need to set the dabase up differently? Or is it the way I'm coding the string?<br /><br />Here is my code:<br /><br />DateTimeEntrance = Now()<br />IPAddress = Request.ServerVariables("remote_addr")<br />UserAgent = Request.ServerVariables("HTTP_USER_AGENT")<br />Browser = BC.Browser & " " & BC.Version<br />DHTMLSupport = cstr(BC.dhtml)<br />FramesSupport = cstr(BC.frames)<br />TablesSupport = cstr(BC.tables)<br />CookiesSupport = cstr(BC.cookies)<br />BackgroundSounds = cstr(BC.backgroundsounds)<br />JavaScriptSupport = cstr(BC.javascript)<br />JavaAppletsSupport = cstr(BC.javaapplets)<br />ActiveXControlsSupport = cstr(BC.activexcontrols)<br />AOL = cstr(BC.aol)<br />Platform = cstr(BC.platform)<br />VBScriptSupport = cstr(BC.vbscript)<br /><br />mySQL = "insert UTVisitors (DateTimeEntrance, IPAddress, UserAgent, Browser, "<br />mySQL = mySQL & "DHTML, Frames1, Tables1, Cookies, BackgroundSounds, JavaScript, "<br />mySQL = mySQL & "JavaApplets, ActiveXControls, AOL, Platform, VBScript) values ("<br />mySQL = mySQL & "'" & DateTimeEntrance & "', "<br />mySQL = mySQL & "'" & IPAddress & "', "<br />mySQL = mySQL & "'" & UserAgent & "', "<br />mySQL = mySQL & "'" & Browser & "', "<br />mySQL = mySQL & "'" & DHTMLSupport & "', "<br />mySQL = mySQL & "'" & FramesSupport & "', "<br />mySQL = mySQL & "'" & TablesSupport & "', "<br />mySQL = mySQL & "'" & CookiesSupport & "', "<br />mySQL = mySQL & "'" & BackgroundSounds & "', "<br />mySQL = mySQL & "'" & JavaScriptSupport & "', "<br />mySQL = mySQL & "'" & JavaAppletSupport & "', "<br />mySQL = mySQL & "'" & ActiveXControlSupport & "', "<br />mySQL = mySQL & "'" & AOL & "', "<br />mySQL = mySQL & "'" & Platform & "', "<br />mySQL = mySQL & "'" & VBScriptSupport & "') "<br /><br />conn.Execute mySQL<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve (sschofield@aspfree.com)</b></i><br /><br />might want to use the cdate(blahvariable) around it to format to convert to a date. not familar with phpmydb though.<br /><br />steve<br /><br />------------<br />Neal at 2/27/2000 12:25:21 PM<br /><br />Hello,<br /><br />I am trying to get my database to post a date.<br /><br />It keeps putting zeros in the date time column ie. 0000-00-00 00:00:00<br /><br /><br />I'm using phpmyadmin for the database. Do I need to set the dabase up differently? Or is it the way I'm coding the string?<br /><br />Here is my code:<br /><br />DateTimeEntrance = Now()<br />IPAddress = Request.ServerVariables("remote_addr")<br />UserAgent = Request.ServerVariables("HTTP_USER_AGENT")<br />Browser = BC.Browser & " " & BC.Version<br />DHTMLSupport = cstr(BC.dhtml)<br />FramesSupport = cstr(BC.frames)<br />TablesSupport = cstr(BC.tables)<br />CookiesSupport = cstr(BC.cookies)<br />BackgroundSounds = cstr(BC.backgroundsounds)<br />JavaScriptSupport = cstr(BC.javascript)<br />JavaAppletsSupport = cstr(BC.javaapplets)<br />ActiveXControlsSupport = cstr(BC.activexcontrols)<br />AOL = cstr(BC.aol)<br />Platform = cstr(BC.platform)<br />VBScriptSupport = cstr(BC.vbscript)<br /><br />mySQL = "insert UTVisitors (DateTimeEntrance, IPAddress, UserAgent, Browser, "<br />mySQL = mySQL & "DHTML, Frames1, Tables1, Cookies, BackgroundSounds, JavaScript, "<br />mySQL = mySQL & "JavaApplets, ActiveXControls, AOL, Platform, VBScript) values ("<br />mySQL = mySQL & "'" & DateTimeEntrance & "', "<br />mySQL = mySQL & "'" & IPAddress & "', "<br />mySQL = mySQL & "'" & UserAgent & "', "<br />mySQL = mySQL & "'" & Browser & "', "<br />mySQL = mySQL & "'" & DHTMLSupport & "', "<br />mySQL = mySQL & "'" & FramesSupport & "', "<br />mySQL = mySQL & "'" & TablesSupport & "', "<br />mySQL = mySQL & "'" & CookiesSupport & "', "<br />mySQL = mySQL & "'" & BackgroundSounds & "', "<br />mySQL = mySQL & "'" & JavaScriptSupport & "', "<br />mySQL = mySQL & "'" & JavaAppletSupport & "', "<br />mySQL = mySQL & "'" & ActiveXControlSupport & "', "<br />mySQL = mySQL & "'" & AOL & "', "<br />mySQL = mySQL & "'" & Platform & "', "<br />mySQL = mySQL & "'" & VBScriptSupport & "') "<br /><br />conn.Execute mySQL<br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > DateTime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|