Hello all, 

I'm having a problem getting PHP to run a query against a MSSQL 7 database.
I have installed PHP, the MSSQL client tools and the php_mssql.dll all
according to the documentation.

PHP will connect to the database just fine.  But if I send the query to
execute it will never return, no error, no results; the browser will
eventually time out.  The query will run from fine from the client tools on
the server.  Here is the simple code on trying to get to run:

<?
  /*All  variables have been set already*/

  echo "<h3>Begin</h3>";

  $linkID = mssql_connect($hostname,$username,$password) or DIE("DATABASE
   FAILED TO RESPOND.");

  echo "<h3>Connected</h3>";

  mssql_select_db($dbName) or DIE("Table unavailable");

  echo "<h3>DB Set</h3>";
  flush();
  sleep(20);  /* Sleep for debug - to allow me to see php loggin in db */
  die();

  /**** I can get to here - no problems - sp_who inside the  MSSQL db
         shows I'm connected successfully and  am using the DB I've
         requested.  If I remove the above 'die' or move it to just  after
         the mssql_query statement below this page will never return.
   ****/


  $query = "SELECT getdate()";
  $result = mssql_query($query, $linkID);

  echo "<h3>Query Submitted</h3>";

  /* code to retrieve and display results goes here */

?>

So can anyone give me some hints? Is there a special place to look for error
messages? The database server doesn't think any error or query has happened
and apparently the Web server is waiting for the database server to reply.

Thanks in advance, 
Frank    [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to