Different results in Query (SQL Server 2005) with PHP and Management Studio
- From: D0MZE <domze.sa@xxxxxxxxx>
- Date: Thu, 23 Oct 2008 10:33:19 -0700 (PDT)
Hey guys,
I have a query here that gives the right results in SQL Management
Studio but wrong results in PHP (using mssql libraries under FreeBSD
using FreeTDS)
The query is as follow:
SELECT ROW_NUMBER() OVER (ORDER BY count DESC), s.*
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY t.field1), t.blah, ....,
(SELECT COUNT(field2) FROM x WHERE x.fieldx=t.fieldx) AS count
FROM table t
WHERE CONTAINS(t.field3,'"some stuff"')
) AS s
In this query, in management studio the results are the desired
results
however in PHP, the field count is like incremented and doesn't give
the right results..
for instance,
management studio:
count for many records go from 1 1 1 0 0 0 0 ...
in php
count for many records go from 3 3 3 2 2 1 1 0
where it shouldnt be that...
Any idea on that?
Thanks!
.
- Prev by Date: How to find a quote in a string
- Next by Date: Re: HTML Diff problem
- Previous by thread: How to find a quote in a string
- Next by thread: '<?' versus '<?php'
- Index(es):
Relevant Pages
|
Loading