[英]Mysql out of space in PHP
在PHP中,我需要這樣的東西:
1) if('out of space' == mysql_error($link))
2) if(10 == mysql_error($link))
3) if(true == mysql_error('out of space'))
4) if(... whatever ....)
5) if(1024 == mysql_errno($link))
{
echo 'DB is out of space';
}
你可能正在尋找errno代碼1021(ER_DISK_FULL)和/或1041(ER_OUT_OF_RESOURCES)
switch( mysql_errno($link) ) {
case 1021:
// handle ER_DISK_FULL
break;
case 1041:
// handle ER_OUT_OF_RESOURCES
break
...
也可以看看
https://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html#error_er_disk_full
https://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html#error_er_out_of_resources
(也許是1037,1038)
if (mysql_errno($link) == 10) {
}
要么...
if (strpos(mysql_error($link), 'out of space') !== false) {
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.