php - Is there a quick way to populate array from DB with record id? -


(simplification)
have table [id][username]
when fetch table not get

[ 0=>[10,'unam1'], 1=>[20,'unam2'], ... ] 

but rather use record id array key. there way in php5.4? use pdo.

[ 10=>[10,'unam1'], 20=>[20,'unam2'], ... ] 

or

[ 10=>['unam1'], 20=>['unam2'], ... ] 


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -