PHP实战基础——以一个新闻cms的增删改查为例 一.        环境配置 二.        数据库创建 三.        增删改查demo 连接数据库 <?php $link=mysql_connect("localhost","root","root"); mysql_select_db("demo",$link); mysql_query("set names utf8"); ?>…
jeesite配置指南(官方文档有坑,我把坑填了!)这篇文章里,我主要把jeesite官方给出的帮助文档的坑填了,按照里面的方法可以搭建起来jeesite的站点.系统可以运行以后,就可以进入开发模块了,我们先从数据的增删改查做起. 一.页面效果 很简单,涉及到的就是数据的增删改查. 二.如何利用jeesite做呢? 上面我们也看到了,功能很简单,那么怎么利用jeesite做呢?jeesite能给我们提供什么便利呢? 第一步.建表 利用jeesite之前,要先建数据表. 至于怎么建表,方法太多了,…
增: //save返回true false $res = new member(); res->username = 'a'; $res->password = 'b'; dd($res->save()); //返回插入数据的数组array $res = member::create(['username'=>'add','password'=>'addp'])->asArray(); dd($res); //create只能添加一条,如果需要批量插入用insert M…
//解除绑定蓝牙 //http://www.520m.com.cn/api/pet/remove-binding?healthy_id=72&pet_id=100477&access-token=YWdqPCWdt3_IqkrTK-U5vS458ZWfcdeT public function actionRemoveBinding(){ $healthy_id = Yii::$app->request->get('healthy_id'); if(empty($healthy_…
package cn.happy.test; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.junit.After; import org.junit.Before; import org.junit.Test; import cn.happ…
package cn.happy.util; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; /** * 1.1用于生产session对象的工具类 */ public class HibernateUtil { private static Configuration cfg=new Configuration().configur…
//实例化db $db = new \yii\db\Query(); //插入 $db->createCommand()->insert('user', [ 'name' => 'test', 'age' => 30, ])->execute(); //获取最后插入的id Yii::$app->db->getLastInsertID() //批量插入 $db->createCommand()->batchInsert('user', ['name',…
完整项目结构 1.maven配置文件pom.xml <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additi…
一.recourses中核心配置文件mybatis-config.xml 二. recourse中jdbc.properties 三.entity实体类 四.ISmbmsUserDao层 五.ISmbmsUserDao.xml层 六.MybatisTest测试类…
一.recourses中核心配置文件mybatis-config.xml 二. recourse中jdbc.properties 三.entity实体类 四.Dao层 五.ISmbmsUserDao.xml层 六.MybatisTest测试类…