摘要: 1,select count(*) as number from admin //查询数据表里面数据总数;as:只为字段数据起别名2,获取数据列表$date=array();while($row=mysql_fetch_assoc()){ }$date[]=$row 阅读全文
posted @ 2012-12-24 21:17 shangshuc 阅读(184) 评论(0) 推荐(0)
摘要: 1,数据库select * from news where title '%中义%' or '%工程%' //这里like'%中义%' 是一个条件 , 而'%工程%' 单独是一个条件。 //如果要查找 中义 或 工程 ,则必须用select * from news where title like '%中义%' or title like '%工程%'2,查数select count() from news //查找数据表中条数。3,修改语句update product set content=&# 阅读全文
posted @ 2012-12-24 19:58 shangshuc 阅读(128) 评论(0) 推荐(0)
摘要: 本函数将字符串 string 的第 start 位起的字符串取出 length 个字符。若 start 为负数,则从字符串尾端算起。若可省略的参数 length 存在,但为负数,则表示取到倒数第 length 个字符。使用范例<?echo substr("abcdef", 1, 3); // 返回 "bcd"echo substr("abcdef", -2); // 返回 "ef"echo substr("abcdef", -3, 1); // 返回 "d"echo s 阅读全文
posted @ 2012-12-21 14:40 shangshuc 阅读(144) 评论(0) 推荐(0)