MyBB Community Forums

Full Version: SQL Query with PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Somehow, my board has been getting this issue repeatedly:
And I always have to go to PHPmyAdmin to execute the same SQL query over again when it occurs.

How do I execute a SQL Query thru PHP file?

you can try below code segment in a file (name can be showimages.php)
upload the file to forum's main folder where global.php exists & run it when required
define('IN_MYBB', 1);
require_once "global.php";
        $db->write_query("UPDATE " . TABLE_PREFIX . "users SET `showimages`= '1' ");
		echo ("Done.");
Thanks, I'll give it a go!