Home > Backend Development > PHP Tutorial > php连接mssql数据库有关问题

php连接mssql数据库有关问题

WBOY
Release: 2016-06-13 13:15:03
Original
836 people have browsed it

php连接mssql数据库问题
我想搞个注册页面(数据库是mssql的,)
php如何存取数据进mssql?
没用过mssql不知道是否与mysql相同

数据库名:GFS
表: user_table

里面有
id

username
pw

就这几个,帮我搞下




------解决方案--------------------

PHP code


<?php //Returns records with Id#46 or first name starting with 'Mary'

$server = '127.0.0.1'; 
$link = mssql_connect($server, 'sql_user', 'sql_user_pass'); 

//Select DB 
$dbn = 'GFS'; 
mssql_select_db($dbn); 

//input variables
$name='Mary%';
$id=46;

//necesssary for stored procedure
$params="@name varchar(50),@id int";
$paramslist="@name='$name%',@id='$id'";

$sql = "select * where user_table" ;

//important to have the "N'" !

$result=mssql_query($dbsql,$link);
?> <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template