Dear friends,
I am having problems to display date when I use php and adodb with mssql server.
My php and adodb is inside Linux Box. I can connect to it and execute the sql statement. But when it comes to get the data from sqlserver, the month automatically decrease 1, lets say it supposed to be April, but it displays as 03 (March).
Here is my code:
<?php
echo "Using standart php connection : <br>";
$msdb=mssql_connect('192.168.1.111:1433','xxx','xxxxx');
$select_db=mssql_select_db('appdb', $msdb);
echo $sql="select top 1 * from tbldeliver";
echo "<br>";
$msquery=mssql_query(mysql_escape_string($sql));
$array=mssql_fetch_row($msquery);
print_r($array);
class dbtest {
function dbtest(){
$this->MSSQLConnect();
}
function MSSQLConnect(){
require("adodb/adodb.inc.php");
$this->mssql= &ADONewConnection('mssql');
$this->mssql->Connect(msSqlHost,msSqlUser,msSqlPass,msSqlDb);
return true;
}
}
$run=new dbtest();
echo "adodb query using Getall: <br>";
echo $sql="select top 1 * from tbldeliver";
echo "<br>";
$msOb = $run->mssql->Execute(mysql_escape_string($sql));
print_r($msOb);
?>
It displays as below:
Using standart php connection :
select top 1 from tbldeliver
Array
(
[0] => 2
[1] => Apr 24 2006 08:02PM
[2] => 713767
[3] => GAME
[4] => 62811992551
[5] => TELK
[6] => 021
[7] => 11000
[8] => SENT
[9] => 6789
[10] =>
[11] => ¡/æÔÚ¬
)
adodb query using Getall:
select top 1 from tbldeliver
Array
(
[0] => Array
(
[0] => 2
[1] => 2006-03-24 20:02:50
[2] => 713767
[3] => GAME
[4] => 62811992551
[5] => TELK
[6] => 021
[7] => 11000
[8] => SENT
[9] => 6789
[10] =>
[11] => ¡/æÔÚ¬
)
)
Anyone could help me please?
Thanks in advance