MS SQL sqlsrv PHP5.3.5
Environment: Apache 2.2.22, PHP 5.3.5, Database MSSQL2008
MSSQL This is PHP5.3 previous version of, how to change the following code to PHP5.3 version, that is, sqlsrv function, I have tried to correct part, but always error, all can only ask for help!!
$PAGECNT) {$CurrentPage = $PageCnt;} Set Start Page $start= $CurrentPage -3;//set End page number $end= $CurrentPage +3;//prev $prvpage= $CurrentPage -1;//Next $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) * $PageSize. "Mid from Myfriends)";} echo $sqlstr; $result =mssql_query ($SQLSTR);//return result set/*mssql_fetch_row//row data mssql_fetch_field//fetching column data */?><title></title>
Reply to discussion (solution)
In general, it is possible to change MSSQL to SQLSRC, but pay attention to the position and meaning of each parameter.
There are some functions sqlsrv_ not, such as mssql_fetch_row corresponding to the sqlsrv_fetch_row is not, with SQLSRV_FETCH_ARRAY/SQLSRV_FETCH_OBJEC instead.
Specific Reference manual Bar
In general, it is possible to change MSSQL to SQLSRC, but pay attention to the position and meaning of each parameter.
There are some functions sqlsrv_ not, such as mssql_fetch_row corresponding to the sqlsrv_fetch_row is not, with SQLSRV_FETCH_ARRAY/SQLSRV_FETCH_OBJEC instead.
Specific Reference manual Bar
Can you provide a reference to this manual? Download a lot of PHP manuals on the internet, do not have this function (sqlsrv)
http://www.php.net/manual/zh/book.sqlsrv.php
http://php.net/manual/zh/book.sqlsrv.php