Random notes on coding
shpeacelover
posted @ 2014年4月08日 15:16
in 未分类
, 396 阅读
1. 关于在css中使用control flow.
#container{ <% IF need_sample %> width: 800px; <% ELSE %> width: 500px; <% END %> }
2. 对于Perl里的DBI模块, 有以下的routine:
$dbh - DBI->connect(); die("Failed to connect to the DB\n") unless $dbh; $query = "select ...."; $sth = $dbh->prepare($query); $sth->execute(); while (my ($mid) = $sth->fetchrow_array()) { $cl{$mid}++; } $sth->finish();
blog comments powered by Disqus