Mysql help please

I need to convert the table into this form: id1 goes down the first column, and id2 is in the first row. How can i do this, please? can you give me some help? thank you!

What have you tried so far?

what backend language are you using to add or query stuff on your database?