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.
Hi,

Somehow, my board has been getting this issue repeatedly: http://community.mybb.com/thread-159286.html
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?

Thanks.
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
<?php
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!