php and SQL server

I’ve got a php file that works just fine on the MySql server database. I also have a SQL server express database, and tried the same script out on that database…I seem to be able to make the connection to the database, and I changed the references to MYSQL_query() to mssql_query(). The script keeps returning the error
mssql_query(): supplied argument is not a valid MS SQL-Link resource
is there anything else I need to know to get this to work on the SQL Server Express? Does MSSQL_Query take different arguments, or do they have to be in a different format or what?

I don’t have much experience with PHP and SQL Server, but this might help: php & MS SQL Server Express?.

One thing to remember is that SQL Server Express is a named instance of SQL Server, not the default instance. What this means is that the server name parameter needs to be servername\SQLEXPRESS, not just servername.

thanks…although it doesn’t seem to be a problem connecting to the database; I had that problem initially and fixed it so it stops giving the ‘unable to connect’ error.
And I’ve gotten other php scripts to run on this server as a test, simple “Hello World” type stuff. But doing anything to this SQl database is proving difficult.

It’s possible that the SQL query you’re passing isn’t supported by SQL Server Express - have you tried running the query directly against the database, using Management Studio? Then you’ll at least know that the query is valid.

the query works in management studio–it’s just a simple select * from table

the code that’s giving me trouble is this:

<html>
<head>
<title>test</title>
</head>
<body bgcolor=“black” text=“white”>
<?
$con = mssql_connect(’./SQLEXPRESS’,‘username’,‘pasword’);
mssql_select_db(‘myDatabase’, $con)

$sql=“SELECT * FROM t_table”;
$result=mssql_query($sql,$con);

?>
</body>
</html>

I changed the username and password to post here, and there is more to the code, but that select statement is on the line that is now returning the error ‘unexpected t_variable’, which is different than what I got before.