sql server - PHP mssql_affected_rows vs mssql_rows_affected -


i use php 5.4.24 microsoft sql server 2008r2, both on windows , linux. on linux, use freetds-0.91-clean. on windows, in phpinfo() mssql extension says "library version: freetds"

the function mssql_affected_rows:

  • works on linux, not on windows
  • is consistent other databases (e.g. sybase_affected_rows, mysql_affected_rows, pg_affected_rows)
  • is not documented on www.php.net

the function mssql_rows_affected:

  • works on windows, not on linux
  • is not consistent other databases (e.g. sybase_affected_rows, mysql_affected_rows, pg_affected_rows)
  • is documented on www.php.net

why these 2 names? makes hard have same code running on both systems.

for future readers, here wrapper wrote works in both cases:

function getaffectedrows()     {     if ( function_exists( 'mssql_affected_rows' ) )         return mssql_affected_rows( $conn ) ;     else         return mssql_rows_affected( $conn ) ;     } 

reference: http://php.net/manual-lookup.php?pattern=mssql_affected_rows

php inconsistent in many ways, said has "fractal bad design" , it's true.... in every aspect , update more , more fails.

for me , many others order of needle / haystack in functions exasperating without ide or @ least editor notepad++ / st

http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -