当前位置: 代码迷 >> 综合 >> 07thinkphp tp find方法 返回1维数组
  详细解决方案

07thinkphp tp find方法 返回1维数组

热度:43   发布时间:2023-10-10 23:33:55.0

 sql查询!

 07thinkphp tp find方法 返回1维数组

PHP 

$res = Db::table('tb_user')->where('phone',$data['phone'])->find();

dump打印

array (size=6)'id' => int 32'username' => string '' (length=0)'password' => string 'b492a9886393b6c1aaf5a2bb6efbd8f4' (length=32)'phone' => string '15267840333' (length=11)'created' => string '2020-01-05 23:28:16' (length=19)'salt' => string 'a1840i' (length=6)

日志 

[ info ] [ PARAM ] array ('/home/login/login' => '','phone' => '15267840333','password' => 'asdsadsad','m1' => '2',
)
[ info ] [ DB ] INIT mysql
[ sql ] [ DB ] CONNECT:[ UseTime:0.002463s ] mysql:host=127.0.0.1;dbname=heima;charset=utf8
[ sql ] [ SQL ] SHOW COLUMNS FROM `tb_user` [ RunTime:0.009433s ]
[ sql ] [ SQL ] SELECT * FROM `tb_user` WHERE  `phone` = '15267840333' LIMIT 1 [ RunTime:0.001166s ]

 

 

  相关解决方案