RE: [PHP-DB] quetion about Win PHP mssql

2001-12-14 Thread Shane Peery

This is as far as we got on the question of W2k based PHP with mssql.  Just
wondered if anyone out there had any further questions.

Thanks,

Shane

-Original Message-
From: Shane Peery 
Sent: Thursday, December 13, 2001 1:35 PM
To: 'Joshua Hoover'
Subject: RE: [PHP-DB] quetion about Win PHP  mssql


Hi Joshua,

I get the same data back when I try that.  Here is the resultset I should be
getting back:

12/05/2001 shane
NULL

(From query analyzer.)

This is a tuff one.

I'm also getting a strange result set from another page with a link to a
function with coalesce in it.

Here is the result set from QueryAnalyzer

shane,justin
justin
NULL

Here is the result set from PHP

,shane,justin
,justin
*BLANK*

The coalesce function reads as follows:

Select @modList = Coalesce(@modList + ',','')

As you can see, PHP returns an extra comma for some reason at the first of
the string, where SQL and ASP do not.  Any clues on this one?

Here is the raw output of the print_r

Array ( [0] = ,shane,justin [ModeratorNames] = ,shane,justin ) Array ( [0]
= ,justin [ModeratorNames] = ,justin ) Array ( [0] = [ModeratorNames] =
) 



Here is the part of the method of the class that returns this data:

$strMain .= '   td align=center valign=middle class=topics
width=125' . chr(10);
$strMain .= '   ' . $catRS[moderatorNames] . chr(10);
$strMain .= '   /td' . chr(10);

*BTW, should I send this to the list as well?*

Thanks again,

Shane


-Original Message-
From: Joshua Hoover [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 12:28 PM
To: Shane Peery
Subject: Re: [PHP-DB] quetion about Win PHP  mssql


Hi Shane,

Let's try this loop instead and see what you come back with:

for ($i = 0; $i  count($rs = @mssql_fetch_array($result)); $i++){
echo $rs[LastPost] . br;
}

Let me know if this works or not.  I believe the while loop is going through
twice for some reason.

Thanks,

Joshua


 Joshua,
 
 Thanks for the response.  This is what I got when I did the print_r on the
 recordset
 
 Array ( [0] = 12/05/2001 shane [LastPost] = 12/05/2001 shane ) Array (
[0]
 = 12/05/2001 [LastPost] = 12/05/2001 )
 
 So, its returning that date from,  well, somewhere it seems.  But the
 data is as I wrote below.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] quetion about Win PHP mssql

2001-12-13 Thread Shane Peery

I have php setup on the following platform:

Web Server: Win2k IIS
DB Server: MSSQL 2000

I'm having a problem when running a view that acesses a user defined
function.  The function outputs a converted date to varchar + a varchar
string.  The problem is that when I loop through the recordset I get strange
results.  The data currently has one field from the view with data and a
null.  

The code I use to retreive the values is this:


$sql = Select LastPost From vwSubTopicDetails;

$result = mssql_query($sql);

while ($rs = mssql_fetch_array($result)) {
echo $rs[LastPost] . brbr;
}

The data that gets echo'd back is this:

12/05/2001 shane

12/05/2001 


Can anyone tell me why I'm getting the phantom date in the second row of the
recordset?  This seems to be PHP specific, as I've tried running the query
in query analyser and in an ASP page without incident.

Thanks in advance,

Shane Peery

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]