Monday, February 16, 2009

Select Nth Row

SQL Query:
SELECT TOP 1 name FROM (SELECT TOP 9 name FROM master..syslogins ORDER BY name ASC) sq ORDER BY name DESC -- gets 9th row

MSSQL Injection Cheat Sheet

Looping in MSSQL
declare @index integer
set @index = 0
while @index < 10
begin
select 'loop counter = ', @index
set @index = @index + 1
end

Friday, February 6, 2009

Find computer using IP

On command prompt we can type this:

NSLOOKUP

it will show the computer name.

Tuesday, February 3, 2009

Cannot delete file: cannot read from source file or disk


When we receive this kind of error what to do??
The files within this folder is somehow corrupted.
First step is to fix it.
1. Open command prompt (Start -> Run -> cmd)
2. Type chkdsk /F E:\
It will fixed by itself.

Thursday, January 8, 2009

PHP Get User Information

Class features:
* Get User Browser.
* Get User Operating System.
* Get User IP.
* Get User Country.
* Get User Referral + Search Engine.
* Get User Language.
* Check if Flash enabled.
* Check if JavaScript enabled.
* Check user speed (bandwidth).

Download the file.

Reference: here

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 134 bytes)

When you received this kind of error in PHP

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 134 bytes) in /home/www/domains/www.salzwimmer.at/html/gb/PYG.php on line 181


Here's how to resolve in xampp:
1. Enable the Rewrite module.
Open %XAMPP%\apache\conf\httpd.conf in notepad and search for mod_rewrite. You will find a line like:
#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # from the beginning. It will now look:
LoadModule rewrite_module modules/mod_rewrite.so

Restart the Apache web server through XAMPP control panel.

2. Find php.ini in your folder
Change the memory_limit to 64M
Here are the files that I changed:
%XAMPP%\php\php.ini
and
%XAMPP%\apache\bin\php.ini

Find a line like:
memory_limit = 32M ; Maximum amount of memory a script may consume (16MB)

Change to
memory_limit = 64M ; Maximum amount of memory a script may consume (16MB)


Save the file and restart the Apache web server.
You should be able to resolve this error.

To check on the configuration:
1. Go to localhost/xampp
2. Click on the phpinfo()
3. Find for memory_limit
4. See if it's 64M instead of 32M

Friday, December 12, 2008

Sun Ray Effect

This is what I have been searching for long....
At last, i found it.


Click here to view the tutorial.

Thursday, November 27, 2008

Key column information is insufficient or incorrect. Too many rows were affected by update.

In MS SQL 2000, in a table with no primary key/index/constraint, whenever there is duplicate record, we cannot delete any of the duplicate record, it will give this error:
"Key column information is insufficient or incorrect. Too many rows were
affected by update."

So how is the trick to remove this duplication?
I was searching and finally found something.

here's what we can do:
1. find out which are the duplicate records
SELECT col1, col2, count(*)
FROM t1
GROUP BY col1, col2
HAVING count(*) > 1

2. delete the duplicate by using this sql
set rowcount 1
delete from t1
where col1=1 and col2=1

it works!

Reference: here