我自仰头向天笑,笑完我就去睡觉,哈哈哈哈……
摘要: MySQL在查询或者更新数据的时候,有字符串函数可用。截取字符串函数:substring、instr用法如下:update `table` set field5 = SUBSTRING(field5 , 1 , INSTR( field5 ,'-')-1) where id = 1; //这里,要从field5里面最开始一直截取到‘-’的地方(不包括‘-’)。注意,substring是从1开始,而不是一般的程序函数从0开始。字符串链接函数:contact用法如下:update `table` set field5 = concact(field5 , 'somestr& 阅读全文
posted @ 2012-12-29 10:59 轻轻的烟雾 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1 来自:http://www.cnblogs.com/A-Song/archive/2011/12/14/2288215.html 2 3 #测试网址: http://localhost/blog/testurl.php?id=5 4 5 //获取域名或主机地址 6 echo $_SERVER['HTTP_HOST']."<br>"; #localhost 7 8 //获取网页地址 9 echo $_SERVER['PHP_SELF']."<br>"; #/blog/testurl.php10 1 阅读全文
posted @ 2012-12-29 10:51 轻轻的烟雾 阅读(200) 评论(0) 推荐(0) 编辑