随机抽取n个记录的SQL(mysql和sqlserver)
[ 2006-05-27 11:40:34 | 作者: admin ]
mysql: select * from tablename order by rand() limit 10
sqlserver: select top 10 * from tablename order by NEWID()
说明:
NEWID
创建 uniqueidentifier 类型的唯一值。
语法
NEWID ( )
返回类型
uniqueidentifier
例如:
我要随机取数据库里的信息10条,如果你的数据库是sqlserver的话,可用这样的方法:
select top 10 * from tablename order by newid()
sqlserver: select top 10 * from tablename order by NEWID()
说明:
NEWID
创建 uniqueidentifier 类型的唯一值。
语法
NEWID ( )
返回类型
uniqueidentifier
例如:
我要随机取数据库里的信息10条,如果你的数据库是sqlserver的话,可用这样的方法:
select top 10 * from tablename order by newid()
在ASP编程中使用数组
[ 2006-05-27 11:28:46 | 作者: admin ]
在ASP编程中使用数组
数组的定义
Dim MyArray
MyArray = Array(1,5,123,12,98)
可扩展数组
Dim MyArray()
for i = 0 to 10
ReDim Preserve MyArray(i)
MyArray(i)=i
next
将一个字符串分割并返回分割结果的数组
Dim MyArray
MyArray = Split(tempcnt,chr(13)&chr(10))
For I = Lbound(MyArray) to Ubound(MyArray)
Response.Write MyArray(I) & "<br>"
Next
数组排序函数
function..Sort(ary)
KeepChecking = TRUE
Do Until KeepChecking = FALSE
KeepChecking = FALSE
...
阅读全文…
数组的定义
Dim MyArray
MyArray = Array(1,5,123,12,98)
可扩展数组
Dim MyArray()
for i = 0 to 10
ReDim Preserve MyArray(i)
MyArray(i)=i
next
将一个字符串分割并返回分割结果的数组
Dim MyArray
MyArray = Split(tempcnt,chr(13)&chr(10))
For I = Lbound(MyArray) to Ubound(MyArray)
Response.Write MyArray(I) & "<br>"
Next
数组排序函数
function..Sort(ary)
KeepChecking = TRUE
Do Until KeepChecking = FALSE
KeepChecking = FALSE
...
阅读全文…
ASP只有一种数据类型那就是variant
[ 2006-05-27 11:10:17 | 作者: admin ]
ASP只有一种数据类型那就是"variant "。它是一种特殊的数据类型能够根据它
的使用表示很多不同种类的信息。因为它是ASP中唯一的数据类型,它也是ASP中所有
函数返回值的唯一类型。它很简单的,"variant"数据类型能够表示数字或者是字符串
。当你在ASP程序中把它当做是数字,它就自动转化为"Numeric",如果用它为字符串,
它也同样就是"String"了。也就是说,程序中某个数据看起来好像是数字时,ASP就会
猜测它是数字,然后就用最适合数字的方法来处理。相似的,字符串处理也是如此的。
当然,您也可以把数字当做字符串来处理,所需的只是一个" "(引号)而已。Variant
图表类型:除去这些简单的数字和符号类型,"variant"还能更加清楚地表示一些特殊
的数字类型。比如,你能用表示日期(时间)的数字信息。当你用到时间或日期数据时,
所用的变量就表示时间(日期)了。当然,你能够拥有非常丰富的数字信息,
...
阅读全文…
的使用表示很多不同种类的信息。因为它是ASP中唯一的数据类型,它也是ASP中所有
函数返回值的唯一类型。它很简单的,"variant"数据类型能够表示数字或者是字符串
。当你在ASP程序中把它当做是数字,它就自动转化为"Numeric",如果用它为字符串,
它也同样就是"String"了。也就是说,程序中某个数据看起来好像是数字时,ASP就会
猜测它是数字,然后就用最适合数字的方法来处理。相似的,字符串处理也是如此的。
当然,您也可以把数字当做字符串来处理,所需的只是一个" "(引号)而已。Variant
图表类型:除去这些简单的数字和符号类型,"variant"还能更加清楚地表示一些特殊
的数字类型。比如,你能用表示日期(时间)的数字信息。当你用到时间或日期数据时,
所用的变量就表示时间(日期)了。当然,你能够拥有非常丰富的数字信息,
...
阅读全文…
php.ini is searched in these locations (in order)
[ 2006-05-25 14:54:11 | 作者: admin ]
设置php的配置文件
到php的官网查了一下php.ini的资料http://www.php.net/configuration
php.ini is searched in these locations (in order):
SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)
The PHPRC environment variable
...
阅读全文…
到php的官网查了一下php.ini的资料http://www.php.net/configuration
php.ini is searched in these locations (in order):
SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry location)
The PHPRC environment variable
...
阅读全文…
如何消除网页的javascript错误提示
[ 2006-05-24 16:47:25 | 作者: admin ]
<SCRIPT LANGUAGE="JavaScript">
<!--
function HideErrors() {
return true;
}
window.onerror = HideErrors;
// -->
</SCRIPT>
<!--
function HideErrors() {
return true;
}
window.onerror = HideErrors;
// -->
</SCRIPT>
总重复的写,干脆写个模板,copy方便点
<%
Class MyClass
'************************************
'申明私有和公有变量
'************************************
Private x
'public y
'************************************
'定义属性部分
'************************************
'设置属性
Public Property Let myX(xValue)
x=xValue
End Property
'获取属性
Public Property Get myX
myX=x
End Property
'************************************...
阅读全文…
<%
Class MyClass
'************************************
'申明私有和公有变量
'************************************
Private x
'public y
'************************************
'定义属性部分
'************************************
'设置属性
Public Property Let myX(xValue)
x=xValue
End Property
'获取属性
Public Property Get myX
myX=x
End Property
'************************************
阅读全文…
php模块化编程
http://mod.pclib.com/html/view/Channel_1.html
强烈推荐的php相关中文在线手册
http://pclib.com/
/online/Apache2.2中文手册
/online/php5中文手册
/online/mysql3.23.7-alpha中文手册
/online/mysql4.1.0-alpha中文手册
/online/mysql5中文手册
/online/php5中文手册(请使用UTF-8编码)
/online/adodb中文手册
/online/smarty中文手册
/online/cvs中文手册
/online/Hibernate-v3中文手册
/online/Css2中文手册
/online/python v2.4中文手册
FCS参考
http://blog.liu21st.com/
...
阅读全文…
http://mod.pclib.com/html/view/Channel_1.html
强烈推荐的php相关中文在线手册
http://pclib.com/
/online/Apache2.2中文手册
/online/php5中文手册
/online/mysql3.23.7-alpha中文手册
/online/mysql4.1.0-alpha中文手册
/online/mysql5中文手册
/online/php5中文手册(请使用UTF-8编码)
/online/adodb中文手册
/online/smarty中文手册
/online/cvs中文手册
/online/Hibernate-v3中文手册
/online/Css2中文手册
/online/python v2.4中文手册
FCS参考
http://blog.liu21st.com/
...
阅读全文…
想着新写一套 基于php smarty(或fcs) 的cms
[ 2006-05-22 21:55:24 | 作者: admin ]
实现功能如下:
1、基本的cms所涉及的功能
2、程序和界面分离
3、多模板支持
4、多语言支持
1、基本的cms所涉及的功能
2、程序和界面分离
3、多模板支持
4、多语言支持