Paradox DB and TIME field

This is a discussion on Paradox DB and TIME field within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I cant seem to get my odbc_result to work with a Paradox database TIME field. My result always comes back ...


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 10-24-2006
Thorak
 
Posts: n/a
Default Paradox DB and TIME field

I cant seem to get my odbc_result to work with a Paradox database TIME
field. My result always comes back as a date of 1899-12-30.... this is
driving me nuts, thats not a time... thats a date! It also always
returns the exact same date even if the time is different. All the
other odbc_results return the proper information..... just not the TIME
field.
Does anyone know what is going on?!

(This DB was not created by me, so i have to work with the existing
system. Paradox doesnt seem to have a Date/Time field. It seems to be
seperated into two types... DATE or TIME). When I open the Database
using Paradox Viewer i see a value in the TIME field as 04:00:00 pm.

I changed the value of the first data record to be 01:00:00pm to see if
the result from PHP would change to a different date.... but it was the
same date.

Im using PHP 4 (and cant change to 5 to use the Paradox DB PEAR
library)


my code:
//-----------------------------------------------

$db=odbc_connect($ODBC_name,$ODBC_user,$ODBC_pass) or die ("Could not
connect");

# SQL Statement.
$qry = 'SELECT OD.OrderID,
OD.CustomerID,
OD.CustomerName,
OD.Description,
OD.OrdererFirstName,
OD.OrdererLastName,
OD.OrdererPareaCode,
OD.OrdererPhoneNumber,
OD.OrdererPhoneExtention,
OD.OrdererFaxNumber,
OD.OrdererEmailAddress,
OD.SalePersonID,
OD.Status,
OD.OnHold,
OD.DueDate,
OD.DueTime,
OD.ProofDate,
OD.OrderNotes,
OD.SalesTotal,
EMP.EmployeeID,
EMP.FirstName
FROM "Order.DB" OD, "Employee.DB" EMP
WHERE EMP.EmployeeID = OD.SalePersonID
AND OD.Status NOT LIKE \'Closed\'
AND OD.Status NOT LIKE \'Voided\'
AND OD.Status NOT LIKE \'Built\'
AND OD.Status NOT LIKE \'Picked-Up\'
AND EMP.FirstName LIKE \''.$_SESSION['CSR'].'\'
ORDER BY OD.DueDate, EMP.FirstName, OD.OrderID';

$qry = odbc_prepare($db, $qry);
$exe_id = odbc_execute($qry);

while(odbc_fetch_row($qry)){

// Define vars
//----------------------
$OrderID = odbc_result($qry, 'OrderID');
$CustomerID = odbc_result($qry, 'CustomerID');
$CustomerName = odbc_result($qry, 'CustomerName');
$OrderNotes = odbc_result($qry, 'OrderNotes');
$Description = odbc_result($qry, 'Description');
$OrdererFirstName = odbc_result($qry, 'OrdererFirstName');
$OrdererLastName = odbc_result($qry, 'OrdererLastName');
$OrdererPhoneNumberArea = odbc_result($qry,
'OrdererPareaCode');
$OrdererPhoneNumber = odbc_result($qry, 'OrdererPhoneNumber');
$OrdererFaxNumber = odbc_result($qry, 'OrdererFaxNumber');
$OrdererEmailAddress = odbc_result($qry,
'OrdererEmailAddress');
$Status = odbc_result($qry, 'Status');
$DueDate = odbc_result($qry,'DueDate');
$DueTime = odbc_result($qry,'DueTime');
$ProofDate = odbc_result($qry,'ProofDate');
$SalePersonID = odbc_result($qry, 'SalePersonID');
$SalePerson = odbc_result($qry, 'FirstName');
$SalesTotal = odbc_result($qry, 'SalesTotal');

var_dump($DueDate);
var_dump($DueTime);

}

Echo RESULTS:
string(10) "2006-06-15"
string(10) "1899-12-30"

string(10) "2006-07-07"
string(10) "1899-12-30"

string(10) "2006-08-21"
string(10) "1899-12-30"

string(10) "2006-08-23"
string(10) "1899-12-30"

string(10) "2006-09-08"
string(10) "1899-12-30"

string(10) "2006-09-13"
string(10) "1899-12-30"

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 11:14 PM.


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