Is there a way to get mysql wait timeout directly from php?
1 Answer
Just make a normal mysql query.
mysql> show variables where Variable_name='wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.07 sec)
In PHP it'd look something like this.
// it's been a while to there might be typos
$res = mysql_query("show variables where Variable_name='wait_timeout'");
$arr = mysql_fetch_assoc($res);
echo $arr['Variable_name'];
echo $arr['Value'];
2 Comments
anon
Yeah, I know about that. So I can't get this info without sql-query?
Shakti Singh
Your answer is improved updated Feel free to rollback if anything gone wrong