<?php namespace app\controller; use app\BaseController; use think\facade\Db; class Index extends BaseController { public function index13(){ #$query=Db::query("select * from betty13"); #print_r($query); #$execute=Db::execute("insert into user set `phone`='19374581820',`u_name`='小哲' "); #$execute=Db::execute("insert into user set `uid`=100, `phone`='19374581820',`u_name`='小叶' "); #print_r($execute); #$find=Db::table('user')->where('uid','>',1)->select(); #var_dump($find); #$value=Db::table('user')->where('uid',1)->value('u_name'); #var_dump($value); #$col=Db::table('user')->column('u_name'); #var_dump($col); #$data=['phone'=>'19892572123','u_name'=>'fang','uid'=>13]; #$insert=Db::table('user')->insert($data); #var_dump($insert); #修改 $data=['phone'=>'19892572123','u_name'=>'thang','uid'=>13]; $save=Db::table('user')->save($data); var_dump($save); }
创建html应用模块 1.装view模块命令 2.改controller模块 应用框架 use think\facade\View; # public function index() { return View::fetch(); } 2.写文件 C:\phpstudy_pro\WWW\MyTp6\app\view\index\index.html
标签:uid,dump,Db,thinkphp6.0,user,var,table From: https://www.cnblogs.com/betty-123/p/18156243