The following statement runs fine in the MS SQL server management studio. However when I try to execute via PHP the insert does not occur and no errors are returned. I know my connection is valid, all my select statements return properly. What am I missing?
DECLARE @id bigint; SET @id = (SELECT MAX(application_track_id) + 1 FROM application_track_data); INSERT INTO application_track_data (application_track_id,user_id, action_key, action, ip_address, session_id, application) VALUES (@id,1,'584','login','192.168.37.60','05sn3618p61dvmml6pkefuteg2','akamata');
Here is the code I am using to execute the sql.
$result = mssql_query($sql);
if(!$result)
{
print "Error:" . mssql_get_last_message();
}
else
print "Success";