MyBB Community Forums

Full Version: eMods Database Administration Module - Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Whenever I execute a query like this:

DELETE FROM zzzmyforum_adminlog WHERE dateline = "1125963876"

I get stuff like this:



Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/forum/mybb/inc/db_mysql.php on line 136

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/forum/mybb/inc/db_mysql.php on line 151
Query Results There were no results returned matching your query.


But the query still executes!
I'll get this fixed shortly. Smile
Ok, I have a possible fix for this but I'm not currently able to test it to be certain. I'll post the fix below and if you want to try it your welcome to do so...

Find (in admin/eMods/dbtools.php):
$fields = $db->fetch_array($query);
$results = $db->num_rows($query);
if($results > 0)
{
	starttable();

Replace with:
$results = $db->num_rows($query);
if($results > 0)
{
	$fields = $db->fetch_array($query);
	starttable();

If you decide to try it, please let me know whether it worked. Smile
Hmmm, almost works!

I used to get 2 warnings, but you fixed the mysql_fetch_array one, now there still remains this:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/forum/mybb/inc/db_mysql.php on line 151
Query Results There were no results returned matching your query. 

So I guess you are halfway there!
It's strange but I can't seem to reproduce that problem.

Which version of PHP and MySQL are you using?
MySQL: 3.23.58
PHP: 4.3.10
Thanks. Smile

I'll look into this problem further as soon as I can.
Maybe this will help?
Change:
$results = $db->num_rows($query);
if($results > 0)
{
    $fields = $db->fetch_array($query);
    starttable();
to:
if($query) $results = $db->num_rows($query);
if($results > 0)
{
    $fields = $db->fetch_array($query);
    starttable();
or to:
if($results = $db->num_rows($query)) {
if($results > 0)
{
    $fields = $db->fetch_array($query);
    starttable();
I donno where it ends, but you need an } to end the if below the first }