note 73178 rejected from function.mssql-query by nlopess

From: Date: Tue, 13 Feb 2007 22:52:13 +0000
Subject: note 73178 rejected from function.mssql-query by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-123335@lists.php.net to get a copy of this message
Note Submitter: chris7ian at gmail dot com ---- Hi All, I am trying to connect from PHP to a MS SQL DB and the code hang at the MSSQL_QUERY function. The connection is ok, the select db is ok, the problem is when I try to get the "select * from clients". I just import the db to mysql and rename the mssql funtions to mysql and everything is working. Any advice? Regards, Christian Tuohy --the code --- <?php $db_conn = mssql_connect("MyServer2k","sa","za") or die("ERROR: no se puede conectar al servidor"); mssql_select_db("Northwind",$db_conn) or die ("ERROR: no se encuentra la base de datos"); $query_result = mssql_query("SELECT Categories.* FROM Categories") or die ("ERROR: no se puede ejecutar la consulta"); while($result=mssql_fetch_assoc($query_result)) { echo $result['CategoryName']." ".$result['Description']."<br>"; } mssql_close($db_conn); ?> -------

« previous php.notes (#123335) next »