0

I've been looking for a answer for this for some time but no luck. Does anyone know how do I check if the mysql db is full? I'll trigger an email in PHP to myself if the db is full cos I cannot check it constantly manually.

Thanks

Edited by veledrom: ,

2
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by veledrom
0

Website is running on shared hosting. I need a PHP script to check my own database space.

0

Now exactly what I wanted but still good to know about it.

I need something like this:

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';
}

Edited by veledrom: ,

0
switch( mysql_errno($link) ) {
case 1021:
  // handle ER_DISK_FULL
  break;
case 1041:
  // handle ER_OUT_OF_RESOURCES
  break
...
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.