MyBB Community Forums

Full Version: Automated database backups when running SQL queries...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using Nickman's MyCMS plugin from myBBSource and have created a simple page using PHP that runs a few database queries to build an XBox Live Leaderboard.

I've only just noticed, however, that each time the script is run, a new database backup is automatically made - which is very strange. I'm going to guess it's due to my use of external MySQL queries (I'm about to try using $db->write_query instead), but I'm not sure. Any help?
Ok, I'm fairly sure that using $db would solve the problem, but I don't really know how to use it to fetch from the database. I'm currently just using this to test:

<?php
$sql2 = $db->query("SELECT username FROM `".TABLE_PREFIX."users`");
print_r($sql2);
?>

But all tat's being printed to te page is

mysqli_result Object ( ) 

I've also tried with $db->write_query - is there another phrase that I should use instead. I know that $db->write_query works for inserting tables and records, but idk if it's okay for fetching.
Solved this by using $db. Lock please.