Hi,
I'm having a very strange problem. I am currently running PHP v4.3.10 on Windows 2000 SP4, SQL 2000 SP3. I just upgraded PHP from 4.3.4 to 4.3.10. Everything was working just fine prior to this. Now, I can read no problem from my MSSQL database, but when I try to update a record, it doesn't work.
Here is my connection info:
$connection = mssql_connect("servername", "username", "password") or die ("Couldn't connect to the database");
$db_name = "dbname";
$db = @mssql_select_db($db_name, $connection) or die ("db2 connection no work");
The code for updating the DB is:
$sql = "update tso_tools set name='Tool 3', description='Tool number three', state_id=2, date_made='Jan 10 2005', mat_id=1, created_by=233, airplane_id=5 where tool_id=7";
mssql_query($sql, $connection) or die ("SQL: $sql<br> Couldn't update database with tool information - " . mssql_get_last_message());
When it executes, this is the output on the screen:
Couldn't update database with tool information - Changed database context to 'dbname'.
However, if execute the following, everyting works properly:
$sql = "select * from tso_tools";
$result = mssql_query($sql, $connection);
while ($row = mssql_fetch_array($result)) {
echo $row['tool_id'] . "<br>";
}
I have looked and looked but have not been able to find any solution to this. Any and all help is greatly appreciated.
Thanks!
Craig