摘要: /*//方式一:已经过时//1.造一个连接(建立通道)$db = mysql_connect("localhost","root","123");//2.选择要操作哪一个数据库mysql_select_db("mydb",$db);//3.写SQL语句$sql = "select * from In 阅读全文
posted @ 2016-05-11 21:12 半月小兵 阅读(204) 评论(0) 推荐(0) 编辑
摘要: //类:由众多对象抽象出来的//对象:通过类实例化出来的//定义类:class Info{ const p = 3.1425926; //将某些类里面常用到的东西定义为常量,方便使用 public static $class; //static关键字定义静态的 public $code; prote 阅读全文
posted @ 2016-05-11 21:10 半月小兵 阅读(235) 评论(0) 推荐(0) 编辑
摘要: //面向过程/*$r = 5;$m = 3.14*$r*$r;*/ //类和对象//对象:任何东西都可以称为对象,类实例化出来的东西//类:对所有同类的对象抽象出来的东西 //Info: Code,Name,Sex,Nation,Birthday//对象:一条具体的信息 p001 张三 男 汉族 1 阅读全文
posted @ 2016-05-11 21:09 半月小兵 阅读(127) 评论(0) 推荐(0) 编辑
摘要: /正则表达式//斜杠代表定界符 /^$///$str = "好厉害18653378660了hi请勿嫁得好15165339515安徽dah矮冬瓜 拍行业大概啊好广东也欺负偶怕哈";//$reg = "/(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3| 阅读全文
posted @ 2016-05-11 21:08 半月小兵 阅读(766) 评论(0) 推荐(0) 编辑
摘要: //语句//分支语句/*$a = 7;if($a == 5) { echo "相等";}else{ echo "不相等";}*/ //if//if...else...//if...else if...//if的嵌套 /*switch($a){ case 1: echo "11111"; break; 阅读全文
posted @ 2016-05-11 21:07 半月小兵 阅读(106) 评论(0) 推荐(0) 编辑
摘要: <?php echo "hello","aaaa"; //输出语法,可以输出多个字符串 print "world"; //可以输出,只能输出一个字符串 //php是弱类型语言 //$a = 5; //php定义变量以$开头 //echo $a; /* $a = "hello"; $hello = " 阅读全文
posted @ 2016-05-11 21:05 半月小兵 阅读(155) 评论(0) 推荐(0) 编辑
摘要: version() 返回数据库的版本号 connection_id() 返回服务器的连接数 database()、schema 返回当前数据库名 user()、system_user() 返回当前用户 加密函数 password(str) 该函数可以对字符串str进行加密,一般情况下,passwor 阅读全文
posted @ 2016-05-11 21:03 半月小兵 阅读(447) 评论(0) 推荐(0) 编辑
摘要: surdate(),current_date() 返回当前日期 curtime(),current_time 返回当前时间 now(), current_timestamp(), localtime(), sysdate(), localtimestamp() 返回当前日期和时间 year(d), 阅读全文
posted @ 2016-05-11 20:49 半月小兵 阅读(1899) 评论(0) 推荐(0) 编辑
摘要: chat_length(s) 返回字符串s的字符数 concat(s1,s2,..) 将字符串s1,s2等多个字符串合并为一个字符串 cincat_ws(x,s1,s2,....) 同concat(s1,s2,..)函数,但是每个字符串之间要加上x insert(s1,x,len,s2) 强字符串s 阅读全文
posted @ 2016-05-11 20:34 半月小兵 阅读(656) 评论(0) 推荐(0) 编辑
摘要: 数学函数 作用:用于处理数字,包括整型、浮点数等 ABS(x) 返回x的绝对值 SELECT ABS(-1) ——返回1 阅读全文
posted @ 2016-05-11 20:14 半月小兵 阅读(186) 评论(0) 推荐(0) 编辑