07 八 2008 @ 12:10 下午 

1016错误:文件无法打开,使用后台修复或者使用phpmyadmin进行修复。
1044错误:数据库用户权限不足,请联系空间商解决
1045错误:数据库服务器/数据库用户名/数据库名/数据库密码错误,请联系空间商检查帐户。
1054错误:程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖。
1146错误:数据表缺失,请恢复备份数据.
2002错误:服务器端口不对,请咨询空间商正确的端口。
2003错误:mysql服务没有启动,请启动该服务
1005:创建表失败
1006:创建数据库失败
1007:数据库已存在,创建数据库失败
1008:数据库不存在,删除数据库失败
1009:不能删除数据库文件导致删除数据库失败
1010:不能删除数据目录导致删除数据库失败
1011:删除数据库文件失败
1012:不能读取系统表中的记录

More »

Posted By: 大宇
Last Edit: 07 八 2008 @ 12:11 下午

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: mysql
 05 八 2008 @ 4:00 下午 

mt_rand

(PHP 3 >= 3.0.6, PHP 4, PHP 5)

mt_rand – 生成更好的随机数

说明

int mt_rand ( [int min, int max] )

很多老的 libc 的随机数发生器具有一些不确定和未知的特性而且很慢。PHP 的 rand() 函数默认使用 libc 随机数发生器。mt_rand() 函数是非正式用来替换它的。该函数用了 Mersenne Twister 中已知的特性作为随机数发生器,它可以产生随机数值的平均速度比 libc 提供的 rand() 快四倍。

如果没有提供可选参数 minmaxmt_rand() 返回 0 到 RAND_MAX 之间的伪随机数。例如想要 5 到 15(包括 5 和 15)之间的随机数,用 mt_rand(5, 15)

例 1. mt_rand() 范例

<?php
echo mt_rand() . "\n";
echo
mt_rand() . "\n";

echo mt_rand(5, 15);
?>

上例的输出类似于:

1604716014
1478613278
6
Posted By: 大宇
Last Edit: 05 八 2008 @ 04:00 下午

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: php函数
 05 八 2008 @ 3:53 下午 

microtime

(PHP 3, PHP 4, PHP 5)

microtime – 返回当前 Unix 时间戳和微秒数

说明

mixed microtime ( [bool get_as_float] )

microtime() 当前 Unix 时间戳以及微秒数。本函数仅在支持 gettimeofday() 系统调用的操作系统下可用。

如果调用时不带可选参数,本函数以 “msec sec” 的格式返回一个字符串,其中 sec 是自 Unix 纪元(0:00:00 January 1, 1970 GMT)起到现在的秒数,msec 是微秒部分。字符串的两部分都是以秒为单位返回的。

如果给出了 get_as_float 参数并且其值等价于 TRUEmicrotime() 将返回一个浮点数。

注意: get_as_float 参数是 PHP 5.0.0 新加的。

例 1. 用 microtime() 对脚本的运行计时

<?php
/**
* Simple function to replicate PHP 5 behaviour
*/
function microtime_float()
{
    list(
$usec, $sec) = explode(" ", microtime());
    return ((float)
$usec + (float)$sec);
}

$time_start = microtime_float();

// Sleep for a while
usleep(100);

$time_end = microtime_float();
$time = $time_end - $time_start;

echo "Did nothing in $time seconds\n";
?>

Posted By: 大宇
Last Edit: 05 八 2008 @ 03:53 下午

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: php函数
 05 八 2008 @ 3:51 下午 

usleep

(PHP 3, PHP 4, PHP 5)

usleep – Delay execution in microseconds

说明

void usleep ( int micro_seconds )

Delays program execution for the given number of micro seconds.

参数

 

 

micro_seconds
Halt time in micro seconds. A micro second is one millionth of a second.

 

返回值

无返回值。

更新日志

 

 

版本 说明
5.0.0 This function now works on Windows systems.

 

 

范例

例 1. usleep() example

<?php

// Current time
echo date('h:i:s') . "\n";

// wait for 2 seconds
usleep(2000000);

// back!
echo date('h:i:s') . "\n";

?>

上例将输出:

11:13:28
11:13:30
Posted By: 大宇
Last Edit: 05 八 2008 @ 03:51 下午

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: php函数
 

ceil

 
 04 八 2008 @ 1:23 下午 

ceil

(PHP 3, PHP 4, PHP 5)

ceil – 进一法取整

说明

float ceil ( float value )

返回不小于 value 的下一个整数,value 如果有小数部分则进一位。ceil() 返回的类型仍然是 float,因为 float 值的范围通常比 integer 要大。

例 1. ceil() 例子

<?php
echo ceil(4.3);    // 5
echo ceil(9.999);  // 10
?>
Posted By: 大宇
Last Edit: 04 八 2008 @ 01:23 下午

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: php函数

 Last 50 Posts
Change Theme...
  • Users » 1
  • Posts/Pages » 165
  • Comments » 12
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

关于



    No Child Pages.

Linux命令手册



    No Child Pages.

php.ini配置



    No Child Pages.

Memcache协议



    No Child Pages.