|
$ connect = mssql_pconnect ("", "sa", "haha");
mssql_select_db ("UserInfo", $ connect);
$ query = "select * from UserInfo";
$ result = mssql_query ($ query);
$ rows = @mssql_num_rows ($ result);
for ($ i = 0; $ i <$ rows; $ i ++) {
@mssql_data_seek ($ result, $ i);
$ data = @mssql_fetch_array ($ result);
echo "$ data [id] $ data [username] $ data [name]";
}
mssql_close ($ connect);
The code is as above, the data cannot be displayed using SQL authentication mode!
If you comment out the first line, the code runs normally. I guess php is connected using the windows login mode of sql server, but in actual applications, it should be connected using sql authentication mode.
Please friends who have experience in this area help! |
|