Home  >  Article  >  Backend Development  >  SQL SERVER example of PHP connection via ODBC

SQL SERVER example of PHP connection via ODBC

WBOY
WBOYOriginal
2016-08-08 09:33:391057browse

SQL SERVER example of PHP connection via ODBC


$connection = odbc_connect("mydata","userid","passwd");
$query = "select * from tab_1 where no>0" ;
$result = odbc_do($connection,$query) ;
PRint "";
while(odbc_fetch_into($result,&$fields))
{
print "n";
for ($i = 21; $i <= 31 ; $i ++) {
print "
";
}
}
print "
";
odbc_close($connection);
?>

The above introduces the SQL SERVER example of PHP connecting through ODBC, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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