Home  >  Article  >  Backend Development  >  PHP connection query displays mssql data instance_PHP tutorial

PHP connection query displays mssql data instance_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:04:21996browse

php connection query display mssql data instance //It seems that the prefixes of the database processing functions of php and mysql mssql are different. You will know by looking at the examples below.

php tutorial connection query display mssql data example
//It feels like the processing functions of php and mysql tutorial mssql database tutorial only have different prefixes. You will know by looking at the examples below.

$link = mssql_connect("localhost", "sa", "sa") or die("Cannot connect to mssql server");
mssql_select_db("test", $link) or die("Database connection failed");



//Create mssql query statement

$ms_sql = "select * from works where username ='www.bKjia.c0m'";
$mss_rs = mssql_query( $ms_sql );

if( mssql_num_rows( $mss_rs ) )
{
while( $mss_rs = mssql_fetch_object( $mss_rs ))
{
echo "Output value...";
}
}
else
{
echo 'Record does not exist';
}



/*

Note:
mssql_query execute query
mssql_num_rows counts the number of records
mssql_fetch_object saves data to an object
mssql_select_db select database
mssql_connect database connection
This article was originally published on www.bKjia.c0m. Please indicate the source

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630877.htmlTechArticlephp connection query displays mssql data instance // It seems that the prefix of the mssql database processing function between php and mysql is different, as follows Just look at the examples to find out. PHP tutorial connection query display mssq...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn