Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

SQL¾­µä¶ÌС´úÂëÊÕ¼¯

--SQL Server£º
Select TOP N * from TABLE Order By NewID() 
--Access£º
Select TOP N * from TABLE Order By Rnd(ID)  
Rnd(ID) ÆäÖеÄIDÊÇ×Ô¶¯±àºÅ×ֶΣ¬¿ÉÒÔÀûÓÃÆäËûÈκÎÊýÖµÀ´Íê³É£¬±ÈÈçÓÃÐÕÃû×Ö¶Î(UserName) 
Select TOP N *  from TABLE Order BY Rnd(Len(UserName)) 
--MySql£º
Select * from TABLE Order By Rand() Limit 10  
--¿ªÍ·µ½NÌõ¼Ç¼
Select Top N * from ±í
--Nµ½MÌõ¼Ç¼(ÒªÓÐÖ÷Ë÷ÒýID)
Select Top M-N * from ±íWhere ID in (Select Top M ID from ±í) Order by ID  Desc
--Ñ¡Ôñ10´Óµ½15µÄ¼Ç¼
select top 5 * from (select top 15 * from table order by id asc) table_±ðÃûorder by id desc ......

SQL SERVER convertº¯ÊýÈÕÆÚ¸ñʽ»¯Ó¦ÓÃ

Sql Server ÖÐÒ»¸ö·Ç³£Ç¿´óµÄÈÕÆÚ¸ñʽ»¯º¯Êý
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varchar(100), GETDATE(), 5): 16-05-06
Select CONVERT(varchar(100), GETDATE(), 6): 16 05 06
Select CONVERT(varchar(100), GETDATE(), 7): 05 16, 06
Select CONVERT(varchar(100), GETDATE(), 8): 10:57:46
Select CONVERT(varchar(100), GETDATE(), 9): 05 16 2006 10:57:46:827AM
Select CONVERT(varchar(100), GETDATE(), 10): 05-16-06
Select CONVERT(varchar(100), GETDATE(), 11): 06/05/16
Select CONVERT(varchar(100), GETDATE(), 12): 060516
Select CONVERT(varchar(100), GETDATE(), 13): 16 05 2006 10:57:46:937
Select CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967
Select CONVERT(varchar(100), GETDATE(), 20): 2006-05-16 10:57:47
Select CONVERT(varchar(100), GE ......

¡¾SQL Server2008ÐÂÔö¹¦ÄÜС½á¡¿

/*----------------------------------------------------------------
-- Author  :feixianxxx(poofly)
-- Date    :2010-05-12 19:43:03
-- Version:
--      Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86) 
Mar 29 2009 10:27:29 
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Evaluation Edition on Windows NT 6.1 <X86> (Build 7600: )
-- Content:SQL Server2008ÐÂÔö¹¦ÄÜС½á
-- ²Î¿¼SQL Server2008Êý¾Ý¿âϵͳ¿ª·¢£¨¹áͨ£©
----------------------------------------------------------------*/
--ÓÉÓÚûÓùý»òÕß²»ÊìϤ£¬ÓÐЩÄÚÈÝÒ»±Ê´ø¹ý£¬Ö»¶ÔÕÆÎյĶ«Î÷½øÐоÙÀý˵Ã÷
1.°²È«·½Ãæ
1.1¼ÓÃÜ
Ò»¸öÊÇ͸Ã÷Êý¾Ý¼ÓÃÜhttp://topic.csdn.net/u/20100511/17/e370e88f-764a-4d00-b781-75b584f1996e.html£» ÁíÍâÒ»¸öÊDZ¸·Ý¼ÓÃÜ
1.2Éó¼Æ
³ýÁ˵ÇÈë/µÇ³öºÍȨÏÞ¸ü¸ÄÍ⣬»¹Ôö¼ÓÁ ......

phpµÄzipÀ©Õ¹Ó¦ÓÃÀý×Ó

$zip = new ZipArchive;
$res = $zip->open(UPLOAD_DIR.'/attach.zip', ZIPARCHIVE::CREATE);
if ($res === true) {
       foreach ($fileinfo as $value) {
             $zip->addFile(UPLOAD_DIR.'/'.$value['SAVE_NAME'], $value['REAL_NAME']);
      }
      $zip->close();
} ......

PHPÈëÃŵÚÒ»²½

Ò»£¬PHP½Å±¾´úÂë±ê¼Ç
PHPµÄ½Å±¾ÊÇÎļþÖÐÒ»¶ÔÌØÊâ±ê¼ÇËù°üÀ¨µÄÄÚÈÝ£¬ÈçASPÊÇ“<%....%>”,PHP¿É¿´³ÉÊÇ“<?...?>”¡£
È»¶øÎªÁËÊÊÓ¦XML±ê×¼ÒÔ½«PHPǶÈëµ½XML»òXHTMLÖУ¬PHP²»½¨ÒéʹÓö̸ñʽµÄ“<?...?>”£¬¶ø½¨ÒéʹÓó¤¸ñʽ±ê¼Ç“<?php...?>”
´ËÍâPHP´úÂë¿é»¹Ö§³Ö <script language="php">ÌÔ±¦ÍøÍøÉϹºÎïÅ®×°...</script>µÄ±ê¼ÇÐÎʽ¡£
¶þ£¬PHPÖ¸Áî·Ö¸ô·û
PHPµÄÿÌõÓï¾äÐèÒªÓɷֺœ£»”¸ô¿ª£¬µ«¶ÔÓÚPHP½áÊø±ê¼Ç“?>”À´Ëµ£¬ÒòÆä×Ô¶¯Òþº¬Ò»¸ö·ÖºÅ£¬ËùÒÔ²»ÐèҪ׷¼Ó·ÖºÅ¡£
ËùÒÔ£¬Ò»¸öPHP½Å±¾µÄ¸ñʽ¿ÉÈçÏ£º
<?php
/*
............ ;
............ ;
............ ;
............
*/
//×¢Òâ×îºóÒ»ÐпÉÒÔûÓзֺÅ
?>
Èý£¬PHPµÄ×¢ÊÍ
PHP¶àÐÐ×¢ÊÍʹÓà “/* ......... */”
µ¥ÐÐ×¢ÊÍʹÓÓ#”»ò“//”
ËÄ£¬PHPµÄÊä³ö
ASPÖÐʹÓÓ<%=...%>”¿ìËÙÊä³öµ¥ÐУ¬»òʹÓÓ<%Response.Write("...")%>”
ÔÚPHPÖÐÖ±½ÓʹÓÓecho()”»ò“print()”£¬±ÈÈ磺
<?php
echo " ......

PHP: How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown
in the browser URL window. For example if you want to let your visitors
submit a blog post to Digg you need to get that same exact URL. There
are plenty of other reasons as well. Here is how you can do that.
Add the following code to a page:
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
You can now get the current page URL using the line:
<?php
echo curPageURL();
?>

Sometimes it is needed to get the page name only. The following example
shows ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [771] [772] [773] [774] 775 [776] [777] [778] [779] [780]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ