这是我的mysql表
id name ssn phone email**
1 Asok 5466 9865893265 asok@gmail.com
2 Sokan 7856 9562358965 sakan@gmail.com
......
.....
当我使用选择查询时,我会得到结果:
Array ( [0] => Array ( [id] => 1 [name] => Asok [sin] => 5466 [phone] => 9865893265 [email] => asok@gmail.com ) [1] => Array ( [id] => 2 [name] => Sokan [sin] => 7856 [phone] => 9562358965 [email] => sakan@gmail.com ) ...)`
我需要得到这个结果
Array ( [5466] => Array ( [id] => 1 [name] => Asok [sin] => 5466 [phone] => 9865893265 [email] => asok@gmail.com )
[7856] => Array ( [id] => 2 [name] => Sokan [sin] => 7856 [phone] => 9562358965 [email] => sakan@gmail.com ) ...)
使用 sql 查询
这里的索引 5466 和 7856 是字段“ssn”(这是该人唯一的否定)