开发者

Possible to 'Show MySQL Variables' with PHP code onto the browser?

Is this possible:

 mysql_query("SHOW VARIABLES LIKE 'query%'");

in php?

开发者_高级运维

If so how can I display the variables onto the browser?

If it is not possible, which mysql command tool is easiest and free to download?

Thanks


Yes, it's possible, I just tried SHOW VARIABLES LIKE 'max%'

You can show them in the browser like you would show the results from any other query..

$res = mysql_query("SHOW VARIABLES LIKE 'max%'");
while ($row = mysql_fetch_assoc($res)) {
  echo $row['Variable_name'].':'.$row['Value']."<br>\n";
}


I think you can do something like

$result = mysql_query("SHOW VARIABLES WHERE VARIABLE_NAME LIKE 'query%'");
while ($rs = mysql_fetch_assoc($result) {
   foreach($rs as $key => $value) {
        print "{$key}: {$value}<br />";
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜