工做積累

刪除軟件表中多餘的重複記錄,重複記錄是根據單個字段(s_downloadurl)來判斷,只留有sid最小的記錄
create table `temp` select  s_downloadurl,min(sid) as sid from `software` group by   's_downloadurl'   having count('s_downloadurl') > 1;
delete from `software` where 's_downloadurl' in (select 's_downloadurl' from `temp`) and 'sid' not in(select 'sid' from `temp`);


select s_downloadurl from `nsoftware` group by s_downloadurl having count(s_downloadurl)>1
ALTER TABLE `keyword` ADD UNIQUE (`k_id`)




$a='/<td width="310" rowspan="2">([\s\S]*)<a href="([^>]*)">/iU';//正則匹配回車
preg_match($a,$page1,$view4);
print_r($view4);
exit;


www.yardvps.com  買空間的網站
www.vpszz.net  

delete FROM `nkeyword` WHERE `nkeyword`='' and `id`<188034
SELECT * FROM `nkeyword` WHERE `nkeyword`='opera mini kb' and `nkeyword`!=''
select s_name,count(*) as con  FROM `nsoftware` group by s_name order by con DESCphp

SELECT `sid` , count( * ) FROM `nsoftware` GROUP BY `s_sname` HAVING count( `s_sname` ) =1html

//.htaccess裏寫的正則windows

Options +FollowSymLinks
<IfModule mod_rewrite.c>


RewriteEngine on


RewriteCond %{REQUEST_FILENAME} !-d


RewriteCond %{REQUEST_FILENAME} !-f


RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]


RewriteRule ^(.*)/[content|download]/software/(.*)\.html$ $1/Index/[content|download]/software/$2 [QSA,PT]


RewriteRule ^(.*)/windows/(.*)/(.*)\.html$ $1/Index/windows/bg/$2/sm/$3 [QSA,PT]

今天工做中竟然把for循環寫錯了。事實證實,不經意的錯誤。帶來的多是災難性的後果。

RewriteRule ^(.*)/software/(.*)/(.*)\.html$ $1/Index/keyword/software/$2/downloads/$3 [QSA,PT]



</IfModule>網站

相關文章
相關標籤/搜索