date/time field from access 2000 db getting -1 in textbox on form

This is a discussion on date/time field from access 2000 db getting -1 in textbox on form within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am stuck in using Access 2000 with on Windows 2000 server. I get a negitive 1 for a value. ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-29-2004
jim
 
Posts: n/a
Default date/time field from access 2000 db getting -1 in textbox on form

I am stuck in using Access 2000 with on Windows 2000 server. I get a
negitive 1 for a value.


My code

$DB_Conn = new COM("ADODB.Connection") or die("Cannot start connection");
$DB_Conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source='C:\\inetpub\\wwwroot\\co\\calendar.mdb'");

$rs = new COM('ADODB.Recordset') or die("Cannot start rs");

if($sMode=="edit"){
$Query ="SELECT * From tEvents where event_ID =".$event_ID;
$rs->open ($Query, $DB_Conn, 3 );
$event_id = $rs->Fields['Event_id']->Value;
$event_title = $rs->Fields['Event_title']->Value;
$sStart_date = $rs->Fields['start_date']->Value;
$sStart_date = date('m/j/y', $sStart_date);
$end_date = $rs->Fields['end_date']->Value;

$Remarks1 = $rs->Fields['Remarks1']->Value;
$uic = $rs->Fields['uic']->Value;
$cdp = $rs->Fields['cdp']->Value;
$cin = $rs->Fields['cin']->Value;
$instructor = $rs->Fields['instructor']->Value;
$hours_lost = $rs->Fields['hours_lost']->Value;

$start_time = $rs->Fields['start_time']->Value;
// $start_time = $rs->Fields(time('start_time'));
// $start_time = date("H:i:s", $start_time);

$end_time = $rs->Fields['end_time']->Value;






//################
// inside form

<TR>
<TD VALIGN=TOP ALIGN=LEFT WIDTH=27%>&nbsp;<FONT FACE=Verdana SIZE=2>
</td>
<TD VALIGN=TOP ALIGN=LEFT WIDTH=51%>
Start Time
<input type="TEXT" size="7" name="start_time" value="<?
if($start_time == "" ) {
print "8:00";
}else{
print $start_time;
} ?>">
&nbsp; &nbsp; &nbsp; End Time
<INPUT TYPE="TEXT" SIZE="7" NAME="end_time" value="<?
if($end_time == "") {
print "16:00";
}else{
print $end_time;
} ?>">
</TD>

<TD VALIGN=TOP ALIGN=LEFT WIDTH="22%">
<?
if($error_state == "y") {
// pos1 = instr(error_words, "num_of_students")
// print " pos1 = ".$pos1; }
?>
<IMG SRC="error.gif" WIDTH=60 HEIGHT=29 BORDER=0 ALT="">
<? } ?>
</TD>
</TR>





The fields in the DB are date/time type, and format short time.

Thanks for the help
Jim


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0