2 回答
TA贡献1796条经验 获得超4个赞
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/bash
func() { START=$1 END=$2
awk -vstartt="$START" -vendt="$END" 'BEGIN{ startm=mktime(gensub("-", " ", "g", startt) " 0 0 0") endtm=mktime(gensub("-", " ", "g", endt) " 0 0 0")
for(i=startm;i<=endtm;i+=3600*24) print strftime("%Y-%m-%d", i) }' }
func "2013-10-1" "2013-10-5" |
TA贡献1893条经验 获得超10个赞
例子:
数据库表tb的一行数据如下:
field1 field2
abc def
$row=mysql_fetch_assoc($res);
print_r($row);
输出如下:
Array
(
[field1] => abc
[field2] => def
)
$row=mysql_fetch_array($res);
print_r($row);
输出如下:
Array
(
[0] => abc
[field1] => abc
[1] => def
[field2] => def
)
看到差异了没?
还有一个mysql_fetch_row,生产的结果是:
Array
(
[0] => abc
[1] => def
)
- 2 回答
- 0 关注
- 1141 浏览
添加回答
举报