03 2012 档案

摘要:覆盖索引: 索引中有多个字段, 在where和select都有这些字段, 也就是说, 你想要得到的字段在索引中 测试: 表结构 表中数据只有5行 mysql> desc aa;+ + + + + + +| Field | Type | Null | Key | Default | Extra |+ 阅读全文
posted @ 2012-03-31 10:35 myD 阅读(527) 评论(0) 推荐(0) 编辑
摘要:查询 '产品的名字和公司的名字' 从产品表左连接公司表,再左连接用户表,product->company->user① 有where条件:用户名是‘sdf’mysql> explain select product.name pname,company.name cname from product left join company using(cid) left join user using(cid) where user.name = 'sdf' \G*************************** 1. r... 阅读全文
posted @ 2012-03-31 08:54 myD 阅读(298) 评论(0) 推荐(0) 编辑
摘要:子查询形式的执行计划mysql> explain select * from user where id = (select uid from uu where id = 3)\G*************************** 1. row *************************** id: 1 select_type: PRIMARY table: user type: constpossible_keys: PRIMARY key: PRIMARY key_len: 4 r... 阅读全文
posted @ 2012-03-30 14:54 myD 阅读(379) 评论(0) 推荐(0) 编辑
摘要:两个函数:① source/function_common.php----->inserttable()function inserttable($tablename, $insertsqlarr, $returnid=0, $replace = false, $silent=0) { global $_SGLOBAL; $insertkeysql = $insertvaluesql = $comma = ''; foreach ($insertsqlarr as $insert_key => $insert_value) { $insertkeysql .= .. 阅读全文
posted @ 2012-03-28 16:45 myD 阅读(229) 评论(0) 推荐(0) 编辑
摘要:当插入的字符数超过varchar(n)限制的长度时,字符会被截断,不会出错,但会有警告mysql> create table aa(name varchar(12));Query OK, 0 rows affected (0.06 sec)mysql> insert into aa value('qwertyuiopasdf');Query OK, 1 row affected, 1 warning (0.03 sec)mysql> show warnings;+---------+------+-------------------------------- 阅读全文
posted @ 2012-03-28 12:00 myD 阅读(262) 评论(0) 推荐(0) 编辑
摘要:在表tt(id)上建立外键,id不是主键 ,bb(bid)也不是主键 ,出错 创建表bb时建立外键 ,bb(bid)不是主键 tt(id)也不是主键,出错 创建表bb时建立外键,bb(bid)是主键 tt(id)不是主键,出错 创建表bb时建立外键,bb(bid)是主键 tt(id)是主键,成功 查 阅读全文
posted @ 2012-03-28 10:31 myD 阅读(2458) 评论(1) 推荐(0) 编辑
摘要:1.cp_blog.php 和 cp_blog.htm两个文件构成了浏览器中的日志编辑界面2.编辑后 间接 提交本页3.包含function_blog.php也就是函数blog_post()函数体所在的文件include_once(S_ROOT.'./source/function_blog.php');if($newblog = blog_post($_POST, $blog)) {····}4.调用blog_post()函数处理接收到的数据5.返回值$newblog 是一个数组:$blogarr = Array( 'subje 阅读全文
posted @ 2012-03-24 16:22 myD 阅读(231) 评论(0) 推荐(0) 编辑
摘要:一位世界名牌大学的学生发明了一种手机上的软件,非常有用,他在网上让人免费下载试用,然后在试用期满后向愿意继续使用的用户收一些钱,这样几年他也挣了十来万美元。他想成立一家公司把这个软件做大做好。他找到一家风投,正巧这个风投基金的总合伙人是我的朋友,就拉我一起和这个创业者面谈。我们仔细听了他的介绍并且看了他的软件。投资人承认他是个有能力的年轻人,软件也是个好软件,但是不投资。投资人给他算了一笔账。这种手机上的软件要想推广必须在手机出厂时预装,一般来讲,虽然这种软件的零售价可以高达十美元以上,但是手机厂商出的预装费不会超过一毛钱,假定为八美分。通常一个领域在稳定的竞争期会有三个竞争者,不妨假设这个创 阅读全文
posted @ 2012-03-20 21:43 myD 阅读(194) 评论(0) 推荐(0) 编辑
摘要:user 表共有37条记录1.select * 无 where 条件mysql> explain select * from user limit 29,7 \G*************************** 1. row *************************** id: 1 select_type: SIMPLE table: user type: ALLpossible_keys: NULL key: NULL key_len: NULL ref: NULL ... 阅读全文
posted @ 2012-03-19 09:36 myD 阅读(219) 评论(0) 推荐(0) 编辑
摘要:先看代码:user 表+-------------+------+----+| name | age | id |+-------------+------+----+| zhangzhibin | 13 | 1 || lisi | 13 | 2 || wangwu | 18 | 3 || zhangzhibin | 19 | 4 || lisi | 12 | 5 || wangwu | 13 | 6 || zhangzhibin | 11 | 7 || lisi | 1... 阅读全文
posted @ 2012-03-15 15:12 myD 阅读(539) 评论(0) 推荐(0) 编辑
摘要:mysql> explain select * from user group by name,age \G*************************** 1. row *************************** id: 1 select_type: SIMPLE table: user type: ALLpossible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 36 Extra: Us... 阅读全文
posted @ 2012-03-15 10:41 myD 阅读(2143) 评论(0) 推荐(0) 编辑
摘要:第一种情况数据文件 ttt.txt utf8编码1 zhangzhibin 232 lisi 223 wangwu 21mysql> select * from user;+------+-------------+------+| id | name | age |+------+-------------+------+| 0 | zhangzhibin | 23 || 2 | lisi | 0 || 3 | wangwu | 0 |+------+-------------+------+警告:mysql> show warnings ... 阅读全文
posted @ 2012-03-14 14:34 myD 阅读(552) 评论(0) 推荐(0) 编辑
摘要:调用参数(invoke Argument)www.cnblogs.com/terryglp/articles/1775778.html1.作用:调用参数可以被用于存储数据在前端控制器中,然后被传递到Action 、Controller、Router、Dispatcher中去了, 调用参数可以很好的实现将共同的对象或者变量传递到MVC组件中去:2.用法:(setParam()绑定参数,getInvokeArg()取出参数) //In bootstrap:$obj = new MyClass(); $front->setParam('myObj',$obj); //We c. 阅读全文
posted @ 2012-03-09 17:07 myD 阅读(1122) 评论(0) 推荐(0) 编辑
摘要:------zf的入口文件-index.php---------<?php//根据网站目录结构设定包含路径//zf库的路径视情况而定$root = str_replace('\\', '/', dirname(__FILE__));define('ROOT', $root);ini_set('include_path', ini_get('include_path'). PATH_SEPARATOR.ROOT.'/library/'. PATH_SEPARATOR.ROOT.'/lib 阅读全文
posted @ 2012-03-09 14:10 myD 阅读(427) 评论(0) 推荐(0) 编辑
摘要:public function __construct() { // selfpointer needed by some other class methods $this->smarty = $this; if (is_callable('mb_internal_encoding')) {//多字节编码 mb_internal_encoding(SMARTY_RESOURCE_CHAR_SET); } $this->start_time = microtime(true); //... 阅读全文
posted @ 2012-03-09 13:20 myD 阅读(623) 评论(0) 推荐(0) 编辑
摘要:SCRIPT_NAME solves all the problems mentionedin this thread - it's just the script name, without any extra garbage that might be tacked on by the user. PHP_SELF explicitly includes that extra garbage, so solutions in this thread that involve stripping thegarbage ... 阅读全文
posted @ 2012-03-08 15:05 myD 阅读(3097) 评论(0) 推荐(0) 编辑
摘要:在php.ini中的一个设置是include_path ①我们在zendframework源码中会看到很多的require_once('Zend/....'); ② 我们在许多网络上的教程中说:要先把zendframework解压后的文件夹中的library文件夹复制到某某路径(以C:/php为例)下,然后在php.ini修改(添加): include_path = "...;...;C:/php/library"结论: 当php执行require_once时会根据include_path指定的路径结合require_once()所给参数寻找包含过来的文件, 阅读全文
posted @ 2012-03-06 11:47 myD 阅读(303) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示