The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP help
I converted some MySQL code from MySQL to MySQLi and got it working (sort of), just need a little help with the PHP now...
Original code: Code:
if ($_REQUEST['show'] == 'mysqlstats' || empty($_REQUEST['show'])) { print_form_header('', ''); print_table_header('MySQL Stats <span class="normal">mysql_stat()</span>'); print_description_row(si_mysqlstats()); print_table_footer(); } Code:
function si_mysqlstats() { $s = ''; $status = explode(' ', mysql_stat()); while ( list($k, $v) = each($status) ) { $s .= $v . '<br />'; } return $s; } Code that is now working: Code:
if ($_REQUEST['show'] == 'mysqlistats' || empty($_REQUEST['show'])) { print_form_header('', ''); print_table_header('MySQLi Stats <span class="normal">mysqli_stat()</span>'); print_description_row(si_mysqlistats()); print_table_footer(); } Code:
function si_mysqlistats() { $link = mysqli_connect("localhost", "dbusername", "dbpassword", "dbname"); printf(mysqli_stat($link)); mysqli_close($link); return $s; } Also, I would like the display to be: Uptime: 49602 Threads: 4 Questions: 850693 Slow queries: 16 Opens: 3099 Flush tables: 1 Open tables: 747 Queries per second avg: 17.150 Instead of the current: Uptime: 49602 Threads: 4 Questions: 850693 Slow queries: 16 Opens: 3099 Flush tables: 1 Open tables: 747 Queries per second avg: 17.150 Any help would be GREATLY appreciated! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|