Thanks Jeremy, I finally found the solution:
?php
$query=SELECT * FROM DB1 JOIN DB2 ON DB1.dataid=DB2.dataid;
$queryupd=UPDATE DB1 SET dateval='20010101' where dateval='2101';
$hostname = serverdb;
$username = user;
$password = pwd;
$dbName = DB;
mssql_connect($hostname,$username,$password)
What was the error message you received? Also, when passing the variables
to the mssql_connect() function, you need not use quotes since you've
already initialized them to the strings. Pass them as follows: $connection
= mssql_connect($a,$b,$c). Also, you aren't passing the actual sql string