Basic SELECT statements
Let's try to determine how many columns are being selected into page in the preceding screenshot. How much information is being selected and displayed on the login page that we got when we fired the query in the previous section? To do that, we're going to use the order by
statement. We used order by 1
in the preceding section and that returned something acceptable, and order by 1000000
gave us an error, so let's try order by 10
; we will see that we still get an error.
Try an order by 5
and we will see whether that it works. By performing this, we know that there are five columns being selected from a certain table, and it's the accounts
table, which is then displayed on the login page. Let's build our own select
statement and get it executed on the target computer. At the moment, the statement is Select * from accounts where username = 'zaid'
and we're doing order by 1
. Let's see whether we can fix that and get it to select
something that we like. As we are trying...