RE: MSSQL PHP4pl2 Truncates Dates
| From: | Flint Doungchak | Date: | Mon, 17 Jul 2000 15:27:16 +0000 |
| Subject: | RE: MSSQL PHP4pl2 Truncates Dates | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-1121@lists.php.net to get a copy of this message | ||
John and other...
Thanks for trying to help. I'm running an SMP server as well and things seem to
be stable (so I don't think that's it). I just can't get the date to format
correctly.
To add to the scenario, here's a snippet...
$query = "SELECT a.id,quest.name + ': ' + a.name as
quests,team_quest.activity,a.expiration FROM quest AS a JOIN quest
ON a.parent = quest.id
JOIN team_quest
ON a.id = team_quest.quest
WHERE team_quest.team = 6 AND team_quest.final = 0";
$result = mssql_query("$query");
if (!$result) {
fError("S002",$PATH_INFO,"");
}
while ($row = mssql_fetch_array($result)) {
echo "<a href=\"quest.html?questid=$row[id]\">$row[quests]</a>,
$row[activity], $row[expiration]<br>\n\r";
}
The echo returns....
Aug 1 20
where the date in the db is 2000-08-01 00:00:00.000
I'm using the MSSQL7.0 extension for PHP 4.01 pl2.
The date length as defined in SQL Server is 8 but I can't seems to be able to
change that value.
Thanks for all of your help.
> -----Original Message-----
> From: Foley, John [mailto:John.Foley@pollak.com]
> Sent: Monday, July 17, 2000 6:02 AM
> To: 'Flint Doungchak'
> Subject: RE: MSSQL PHP4pl2 Truncates Dates
>
>
>
>
> Sorry for answering a question with a question . . .
> First, blind stab at your problem: Are you pre-dimensioning the
> string length? Post some code, there are several great code
> junkies on the
> list.
>
> Second: Are you running as a CGI or using ISAPI? I have
> precisely
> the same setup, on an SMP server, that is real, real unstable.
> A lot of buzz on the list about Access Violation is
> what I'm seeing.
> How 'bout you?
>
>
> John
>
>
>
> > -----Original Message-----
> > From: Flint Doungchak [SMTP:Flint@netsolutionsllc.com]
> > Sent: Saturday, July 15, 2000 6:04 PM
> > To: 'php-windows@lists.php.net'
> > Subject: MSSQL PHP4pl2 Truncates Dates
> >
> > Hello,
> >
> > I recent installed PHP4 pl2 on IIS4 on SP6a. I'm connecting
> to a MSSQL 7.0
> > SP2
> > database and everything seems to be working well (i.e. i
> can connect and
> > all
> > that). However, when I select a date column, PHP, or MSSQL,
> truncates the
> > date.
> >
> > For instanace '2000-07-10 00:00:00.000' (as reported by
> Query Analyzer) in
> > MSSQL
> > gets passed to PHP as 'Jul 10 2'. Yes, that's a 2 with no
> zeros after it.
> >
> > I've tried converting the date, but that didn't work either
> (it just spits
> > back
> > the same thing). I'm new to MSSQL and miss some of the MySQL
> > straightforwardness
> > but need some of the features of MSSQL.
> >
> > Can some here enlighten me as always.
> >
> > Thanks in advance.
> >
> > -Flint
> >
> > ________________________________________________
> > Flint Doungchak
> > Web Applications Development
> > Net Solutions LLC
> > 840 Lawrence Street
> > Eugene, OR 97401
> > VOICE (541) 345-7087 FAX (541) 485-5519
> > flint@netsolutionsllc.com
> > www.netsolutionsllc.com
>