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