在一个项目中,需要查询表tr_product中的user_id字段,如果user_id相同,则把其对应的money字段相加,数据库截图如下:实现代码:$Model = D('Model');$res =$Model->query("SELECT user_id,sum(money) from tr_...
分类:
Web程序 时间:
2014-07-12 13:11:17
阅读次数:
287
1 dbtype=$dbtype; 14 $this->host=$host; 15 $this->user=$user; 16 $this->pwd=$pwd; 17 $this->dbname=$dbname; 18 }...
分类:
Web程序 时间:
2014-07-12 00:19:40
阅读次数:
246
linux下的文件结构,看看每个文件夹都是干吗用的/bin二进制可执行命令/dev设备特殊文件/etc系统管理和配置文件/etc/rc.d启动的配置文件和脚本/home用户主目录的基点,比如用户user的主目录就是/home/user,可以用~user表示/lib标准程序设计库,又叫动态链接共享库,...
分类:
系统相关 时间:
2014-07-11 23:39:24
阅读次数:
385
System.out.println(System.getProperty("user.dir"));//得到工程所在磁盘路径String mailFilePath = new File("WebRoot").getAbsolutePath()+"\\file\\maiList.txt";//得到w...
分类:
编程语言 时间:
2014-07-11 22:39:36
阅读次数:
243
Hibernate3.0后新增了annotation的配置方式,比起xml有着更加简洁的配置1:修改hibernate.cfg.xml之前标签中配置了hbm资源文件由于现在使用了注解方式代替了hbm文件,所以需要修改mapping标签的内容2:User.java 1 @Entity 2 @Table...
分类:
系统相关 时间:
2014-07-11 22:38:19
阅读次数:
300
在某些情况下,如果明知道查询结果只有一个,SQL语句中使用LIMIT 1会提高查询效率。例如下面的用户表(主键id,邮箱,密码):create table t_user(id int primary key auto_increment,email varchar(255),password var...
分类:
数据库 时间:
2014-07-11 22:15:52
阅读次数:
321
//SituationSystem prompts"xxx is not in the sudoers file"(xxx equals the user name)while executing command "sudo":sudo-iPassword:xxx isnotinthe sudoer...
分类:
其他好文 时间:
2014-07-11 22:09:28
阅读次数:
216
CREATE TABLESPACE dna36 DATAFILE 'D:\oracle\oradata\orcl\dna36.dbf' SIZE 100M AUTOEXTEND ON NEXT 10M maxsize unlimited;CREATE USER dna36 IDENTIFIED BY...
分类:
其他好文 时间:
2014-07-11 22:07:18
阅读次数:
273
只要用到MySQLdb,使用时请先安装MySQLdb,百度上可以下载!#coding=utf-8'''@author:使用python操作MySQL数据库'''import MySQLdb#import MySQLdb.cursorsconn=MySQLdb.connect(user='root',...
分类:
数据库 时间:
2014-07-11 21:12:45
阅读次数:
265
登录某台服务器的mysql时候总报错:mysql2/client.rb:58:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)解决方法: 在windows 下的解...
分类:
数据库 时间:
2014-07-11 21:04:14
阅读次数:
267