Your loop to retrieve the data from the data object is a bit of a mess:
while($ = mysql_fetch_array($sql)) {
$arr[] = array($r[col1]=> $r[col2]);
}
Unless you defined them as a fixed value, col1 and col2 are not valid indices. I suspect you left out the quotes (which you do use in yours what-you-want example.
I also suppose you meant $r and not just $ in you r while conditional test.
Also, if you wish to use one value as the array index, a
guess at what you mean in the 'what I want' example, you'd likely want the content of the loop to look more like:
$arr[$r['col1']] = $r['col2']);
For a start.