Reputation: 4053
I have 1,5k lines od PHP spaghetti code that have dozens of if's generating dozens more queries.
All the conditions are simple "==" or "!=" against list of ~20 possibilities.
Now I need to add 21st... I need to:
How can I enable query logging ( ext of executed query will be enough ) for just that single .php file if code use ODBC php module to talk to SQL Server?
Upvotes: 0
Views: 313
Reputation: 5151
You can user SQL Server Profiler. It will be installed on the server or anywhere you have SQL Sever Management Tools installed. Normally something like this:
"C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\PROFILER.EXE"
If there's a lot happening on your server. You will see a TON of stuff go by and realize it's too much to comprehend. So my suggestion is:
"Application Name=MyAppNameHere;"
Now when you click around in your application it will only log things that you are doing.
You can have this data dropped to a table or a file or you can just look at what is outputted to the screen.
You may find it's helpful to add other columns or events.
Upvotes: 1