2011年7月28日
摘要:
1. 创建用户:(只能从localhost登录)mysql> create user 'user1'@'localhost' identified by 'pass1';可以从任意地方登录mysql> create user 'user1'@'%' identified by 'pass1';2. 分配指定权限mysql> grant select ,insert,update,delete on *.* to 'user1'@'localhost'
阅读全文
posted @ 2011-07-28 11:37
DavidYanXW
阅读(165)
推荐(0)
2011年7月27日
摘要:
转载自:http://hi.baidu.com/firstcaohui/blog/item/905ff40069d5a305738b6568.html<?php/*【插入排序(一维数组)】【基本思想】:每次将一个待排序的数据元素,插入到前面已经排好序的数列中的适当位置,使数列依然有序;直到待排序数据元素全部插入完为止。【示例】:[初始关键字] [49] 38 65 97 76 13 27 49J=2(38) [38 49] 65 97 76 13 27 49J=3(65) [38 49 65] 97 76 13 27 49J=4(97) [38 49 65 97] 76 13 27 49
阅读全文
posted @ 2011-07-27 18:18
DavidYanXW
阅读(241)
推荐(0)
摘要:
转载自:http://hi.baidu.com/32641469/blog/item/073f43fec48ec5235d6008ec.html有关文件上传,Yii提供了一个很重要的类 CUploadedFile在控制器里写一个图像上传的动作 public function actionUploadPhoto() { $model=$this->loadModel(); if(isset(Yii::app()->user->id)) { if(isset($_POST['UserProfile'])) { $model->attributes=$_POS
阅读全文
posted @ 2011-07-27 04:19
DavidYanXW
阅读(383)
推荐(0)
摘要:
转载自:http://hi.baidu.com/done_gone/blog/item/6e1ffc0d6ff23795d1581bf4.html这里不显示,model和view的代码,或者明天补上。控制器代码:$model=new Albums;if(isset($_POST['Albums'])){$model->attributes = $_POST['Albums'];$model->album_image = CUploadedFile::getInstance($model,'album_image');//album_i
阅读全文
posted @ 2011-07-27 04:18
DavidYanXW
阅读(1037)
推荐(0)
摘要:
转载自:http://hi.baidu.com/wastorode/blog/item/70c5cfbb6644861d18d81f19.htmlyii框架提供了activeFileField控件来完成上传文件(当然也包括了上传图片)的操作,下面介绍yii的activeFileField使用方法。1、函数原型:public static stringactiveFileField(CModel$model, string $attribute, array $htmlOptions=array ( ))2、调用例子:(1)首先,设置form,这一步一 定要做,把form设置为’multipar
阅读全文
posted @ 2011-07-27 04:17
DavidYanXW
阅读(723)
推荐(0)
摘要:
转载自:http://hi.baidu.com/wastorode/blog/item/4a59b44128487b31cefca3ff.htmlFirst declare an attribute to store the file name in the model class (either a form model or an active record model). Also declare a file validation rule for this attribute to ensure a file is uploaded with specific extension n
阅读全文
posted @ 2011-07-27 04:16
DavidYanXW
阅读(644)
推荐(0)
摘要:
转载自:http://www.cnblogs.com/ainiaa/archive/2010/07/25/1784564.html一直在做php的开发工作.在开发的过程中老早就听说了“伪静态”这一说。但是一直没有对其进行了解。今天终于下定决定 要好好的了解下这方面的内容。首先,什么是伪静态:伪静态又名URL重写,是动态的网址看起来像静态的网址。换句话说就是,动态网页通过重写URL方法实现去掉动态网页的参数,但在实际的网页目录中并没有必要实现存在重写的页面。另外在补充两个名词解析静态网址:纯静态HTML文档,能使用filetype:htm查询到的网页动态网址:内容存于数据库中,根据要求显示内容,
阅读全文
posted @ 2011-07-27 04:13
DavidYanXW
阅读(218)
推荐(0)
摘要:
转载自:http://blog.csdn.net/t240034137/article/details/4281782原作者拥有所有版权, 本人负责传播!在心底深深的说一句:GOOD BYE!
阅读全文
posted @ 2011-07-27 01:45
DavidYanXW
阅读(341)
推荐(0)
2011年7月25日
摘要:
在linux(ubuntu)环境下, 编译安装PHP的步骤.注: 不同操作系统下, 安装路径不同,请注意!1. 下载php源码$cd /usr/local/src$wget http://cn.php.net/get/php-5.3.6.tar.bz2/from/this/mirror2. 解压缩并安装$tar jxvf php-5.3.6.tar.bz2$cd php-5.3.6/$./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/home/service/m
阅读全文
posted @ 2011-07-25 16:56
DavidYanXW
阅读(484)
推荐(0)
摘要:
转载自: http://enterparse.blog.163.com/blog/static/11713797420096921232931/PS是LINUX下最常用的也是非常强大的进程查看命令1. ps简介前面介绍的两个命令都是用于查看当前系统用户的情况,下面就来看看进程的情况,这也是本章的主题。要对进程进行监测和控制,首先必须要了解当前进程的情况,也就是需要查看当前进程,而ps命令就是最基本同时也是非常强大的进程查看命令。使用该命令可以确定有哪些进程正在运行和运行的状态、进程是否结束、进程有没有僵死、哪些进程占用了过多的资源等等。总之大部分信息都是可以通过执行该命令得到的。2. ps命令
阅读全文
posted @ 2011-07-25 11:12
DavidYanXW
阅读(266)
推荐(0)