MSSQL and ODBC Connections with PHP on Windows
am 18.06.2008 16:43:53 von ajweiHi,
I am a newbie using the combination of PHP and MSSQL together.
Can anyone tell me which method it might be better as far as using PHP o=
n Windows with MSSQL database on a single machine? (The PHP and MSSQL datab=
ase are not set up remotely on two different servers.
I have set up both, and my ODBC Driver does work when I run it from the=
test without using PHP, and yet when I put it in PHP, my entire screen goe=
s blank.
$dsn=3D"MSSQL";
$username=3D"user";
$password=3D"password";
$sqlconnect=3Dodbc_connect($dsn,$username,$password);
$sqlquery=3D"SELECT title FROM books";
$process=3Dodbc_exec($sqlconnect, $sqlquery);
while(odbc_fetch_row($process)){
$Name =3D odbc_result($process,"Name");
echo "$Name
"; }
odbc_close($sqlconnect);
The similar thing happens when I use the code by using a slight modificatio=
n from http://us3.php.net/manual/en/function.mssql-connect.php.
Can anyone please provide me some tips and solutions on what additional mod=
ules or set up I need to get this to work? I was told that if I use Windows=
, I may not have to use FreeTDS.
Thanks in advance.
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php