Hi,

First post here and very new to php so please nothing to complicated.

I have installed the latest edition of PHP on my server using the Installation kit from the PHP web site, into the C:\PHP\ dir.
I am running IIS Version 6 and SQL Server 2000

I have edited the php.ini file to allow this connection and made sure that all
relevant files are in the right place.

I have a very basic piece of php

<?php
// connect
$cs = mssql_connect ( "localhost", "sa", "password" ) //or die ( "Can not connect to server" );

// select
mssql_select_db ( '[test]', $cs ) or die ( 'Can not select database' );

//query
$sql = "SELECT * FROM [all]";
$r = mssql_query ( $sql, $cs ) or die ( 'Query Error' );

// loop the result

while ( $row = mssql_fetch_array ( $r ) )
{
   /* do stuff */
}
?>

The problem is when I run this script I just get a blank page, I have saved the file as a php but it doesn't seem to be doing anything.

Have I done something really stupid and I am just not seeing it. Is there perhaps a web site that shows exactly what you need to do from scratch?
Would it be of any help if I posted my php.ini, although it is rather large!

Thanks Phil

    When you commented out the "or die" portion of the mssql_connect() line, you also commented out its terminating semi-colon.

      Sorry, my mistake in the copy and paste, I was trying to see if the connection was working at all as I had tried putting a bad login to get the error message but no luck. In the script that I am running there is nothing commented out and I am still getting a blank page, it just seems like its not trying to talk to the database at all.

      Sorry for my earlier mistake but any further help would be great.

      Thanks Phil

        Write a Reply...