NOTE: THIS WAS TESTED, AND IT WORKS 100%. IF IT DOESN'T WORK FOR YOU, YOU DID SOMETHING WRONG IN THE PROCESS.
NOTE 2: Take off the Link Variable if you have an include function to include your configurations.
EX:
include('configs/config.php');
Instructions:
1. Execute the 1st Code into the database.
2. Restart MSSQL (Program).
3. Go to Account_DBF and find the LOG_TBL
3a. If it's there, close MSSQL.
3b. If it's not there, execute again.
4. Put the 2nd Code(PHP) into a php file.
5. Access the php file.
6. Open MSSQL, and view the log, Is it in there?
7. If yes, You are now logging actions in your webserver.
Anyone who wants it:
Execute this in MSSQL.
When its executed, restart MSSQL.(Program)
Code:BEGIN TRANSACTION USE ACCOUNT_DBF SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF SET CONCAT_NULL_YIELDS_NULL ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON COMMIT BEGIN TRANSACTION GO CREATE TABLE dbo.LOG_TBL ( ip nvarchar(MAX) NOT NULL, reason nvarchar(MAX) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO ALTER TABLE dbo.LOG_TBL SET (LOCK_ESCALATION = TABLE) GO COMMITPHP Code:<?php
$link = @mssql_connect("Your Computer Name\SQLEXPRESS", "MSSQL UserName(Often SA)", "MSSQL Password") or die ("Cannot connect to MSSQL");
$ip = $_SERVER['REMOTE_ADDR'];
$log = mssql_query("INSERT INTO [ACCOUNT_DBF].dbo.[LOG_TBL] (ip, reason) VALUES ('{$ip}', 'Log Test Successful!')");
if($log) {
echo 'Test Successful!';
}
else
{
echo 'Error Logging';
}
?>





