make username and userid into array php
- by Bharanikumar
i want to my array ,
somthing like this manner
array("userid"=>"username","1"=>"ganeshfriends","2"=>"tester")
mysq query somthing like this
$query = select username, userid from tbluser
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$items = array($row['userid']=>$row['username']);
}
print_r($items);
Can you tell me how to make
userid as key and username as val...
Thanks