Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-19 Thread Thodoris



On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten [EMAIL PROTECTED] wrote:

  

If you need abstraction, check this out:
http://us.php.net/pdo

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




I looked at PDO, and liked it, but it seems really buggy in the version of
php we're running.  I had to stop using it.  We're running 5.1.2.

  
Well from my experience with PDO the does the job pretty well and 
although I use it for mysql I haven't noticed any obvious bug. Update is 
always needed and since I despise development is M$ windowz I don't know 
if there are bugs there.


Well using PDO will do the magic for you if you plan to migrate to 
another database. Since you are writing in an object oriented way as far 
as I can tell then data objects is more suited to your style.


--
Thodoris



Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Dan Shirah
On 9/18/08, Dan Joseph [EMAIL PROTECTED] wrote:

 Hi,

 Anyone else using the odbc_* functions to interact with MS SQL Server 2005?

 I'm having a problem getting odbc_num_rows() to return anything other than
 -1 when querying a stored procedure.  I can get it to work using Top in a
 normal query (non-stored procedure).

 SELECT Top 100 * FROM Table

 if I do an odbc_num_rows( result ) on that, I get the number of rows.
 However...

 EXEC ProcedureName @Var = 'value'

 if I do an odbc_num_rows( result), I get -1.  The same is true if I did a
 straight SELECT * FROM Table.  I've tried putting Top in my query in the
 stored procedure.

 Right now I'm either doing an extra query for @@ROWCOUNT, or I'm doing two
 result sets, a counting query, and then the normal query.  I am concerned
 about performance in doing the two queries, and with @@ROWCOUNT, I feel I'm
 just adding extra things to the code that may be unreliable?

 From what I've read, its something with the ODBC driver, and updating the
 ODBC driver isn't an option.

 Anyone else having this problem?  Any suggestions?

 --
 -Dan Joseph



 Dan,

If you already have your results in an array, try using count($result); That
should count the number of results returned to your result array.

Or you could try uncommenting the mssql extension in your php.ini file and
then try using:

mssql_num_rows() ?

Dan


Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Dan Joseph
On Thu, Sep 18, 2008 at 3:36 PM, Dan Shirah [EMAIL PROTECTED] wrote:


 If you already have your results in an array, try using count($result);
 That should count the number of results returned to your result array.

 Or you could try uncommenting the mssql extension in your php.ini file and
 then try using:

 mssql_num_rows() ?

 Dan




I don't have them in an array usually, I just cycle thru each row.

I've thought about using the mssql_* functions.  My boss originally pushed
me into odbc posing the question What if we move to a different database
server type?.

I do have a class for handling all the database functions.  Maybe I'll just
go that route.  If he changed to Oracle or something, I could modify my
class easy enough.

I'm assuming mssql_num_rows() works fine when calling a stored procedure?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Micah Gersten
If you need abstraction, check this out:
http://us.php.net/pdo

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Dan Joseph wrote:
 On Thu, Sep 18, 2008 at 3:36 PM, Dan Shirah [EMAIL PROTECTED] wrote:

   
 If you already have your results in an array, try using count($result);
 That should count the number of results returned to your result array.

 Or you could try uncommenting the mssql extension in your php.ini file and
 then try using:

 mssql_num_rows() ?

 Dan




 
 I don't have them in an array usually, I just cycle thru each row.

 I've thought about using the mssql_* functions.  My boss originally pushed
 me into odbc posing the question What if we move to a different database
 server type?.

 I do have a class for handling all the database functions.  Maybe I'll just
 go that route.  If he changed to Oracle or something, I could modify my
 class easy enough.

 I'm assuming mssql_num_rows() works fine when calling a stored procedure?

   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Dan Joseph
On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten [EMAIL PROTECTED] wrote:

 If you need abstraction, check this out:
 http://us.php.net/pdo

 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


I looked at PDO, and liked it, but it seems really buggy in the version of
php we're running.  I had to stop using it.  We're running 5.1.2.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Micah Gersten
You can't upgrade PHP?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Dan Joseph wrote:
 On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten [EMAIL PROTECTED] wrote:

   
 If you need abstraction, check this out:
 http://us.php.net/pdo

 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 
 I looked at PDO, and liked it, but it seems really buggy in the version of
 php we're running.  I had to stop using it.  We're running 5.1.2.

   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ODBC Functions MS SQL Server 2005

2008-09-18 Thread Dan Joseph
On Thu, Sep 18, 2008 at 5:35 PM, Micah Gersten [EMAIL PROTECTED] wrote:

 You can't upgrade PHP?

 Thank you,
 Micah Gersten
 onShore Networks
 Internal Developer
 http://www.onshore.com



 Dan Joseph wrote:
  On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten [EMAIL PROTECTED]
 wrote:
 
 
  If you need abstraction, check this out:
  http://us.php.net/pdo
 
  Thank you,
  Micah Gersten
  onShore Networks
  Internal Developer
  http://www.onshore.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
  I looked at PDO, and liked it, but it seems really buggy in the version
 of
  php we're running.  I had to stop using it.  We're running 5.1.2.
 
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


No, unfortunately not.  My boss is opposed to it (or atleast was a while
back).  He wasn't sure how some of his stuff would react to the upgarde.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.