Sqlsrv function problems

Source: Internet
Author: User
Sqlsrv function problem ms SQL sqlsrv PHP5.3.5

Environment: Apache 2.2.22, PHP 5.3.5, and database MSSQL2008
Mssql is a version earlier than PHP5.3. how can I change the following code to a version later than PHP5.3, that is, the sqlsrv function? I tried to change some of the code, but I always reported an error. I can only ask for help here !!
 $ PageCnt) {$ CurrentPage = $ PageCnt;} // set the starting page number $ Start = $ CurrentPage-3; // Set the ending page number $ End = $ CurrentPage + 3; // Previous Page $ PrvPage = $ CurrentPage-1; // Next Page $ NextPage = $ CurrentPage + 1; if ($ Start <1) {$ Start = 1; $ End = $ Start + 6;} if ($ End> $ PageCnt) {$ Start = $ PageCnt-6; $ End = $ PageCnt;} if ($ sqlstr! = "") {$ Sqlstr = "select top ". $ PageSize. "mName, mSex, mBirthday, mTel, mAddress, tname from myfriends, team where myfriends. tid = team. tid and mid not in (select top ". ($ CurrentPage-1) * $ PageSize. "mid from myfriends) and ". $ sqlstr;} else {$ sqlstr = "select top ". $ PageSize. "mName, mSex, mBirthday, mTel, mAddress, tname from myfriends, team where myfriends. tid = team. tid and mid not in (select top ". ($ CurrentPage-1) * $ Pag ESize. "mid from myfriends)" ;}// echo $ sqlstr; $ result = mssql_query ($ sqlstr ); // return result set/* mssql_fetch_row // Retrieve row data mssql_fetch_field // Retrieve column data */?>
 


Reply to discussion (solution)

Generally, you can replace mssql with sqlsrc, but pay attention to the location and meaning of each parameter.
Some functions are not available, such as sqlsrv_fetch_row corresponding to mssql_fetch_row, which is replaced by sqlsrv_fetch_array/sqlsrv_fetch_objec.

Please refer to the manual for details.

Generally, you can replace mssql with sqlsrc, but pay attention to the location and meaning of each parameter.
Some functions are not available, such as sqlsrv_fetch_row corresponding to mssql_fetch_row, which is replaced by sqlsrv_fetch_array/sqlsrv_fetch_objec.

Please refer to the manual for details.
Can I provide a reference to this manual? I have downloaded a lot of PHP manuals online, and I don't have this function (sqlsrv)

Http://www.php.net/manual/zh/book.sqlsrv.php

Http://php.net/manual/zh/book.sqlsrv.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.