Dear All,
I have found a lot on the web about date and time functions in PHP, but not much about using them in conjuction with a Sybase database. Can anyone help?
I can put a timestamp into my Sybase database easily enough with something like:
$ts = time();
sybase_query("INSERT INTO mytable VALUES ('$ts')");
Then when I go into the DB directly, and query the table with SQL, everything is fine. The timestamp is there, and looks something like:
0x00000001005be2ed
HOWEVER, when I try to retrieve that information with something like:
$data = sybase_query("SELECT time_stamp FROM mytable");
$res = sybase_result($data, 0, time_stamp);
echo $res;
The output is just:
00000001
In other words, the retrieval has only pulled HALF of the time stamp! If I try to interpret this as a date with gettime() or something, the result will always be that it is Dec 31, 1969.
Does anyone know why it does this or how the heck I can make it pull the full timestamp out of the database?
much obliged,
sgibolon