mysql_fetch_array() problems with multiple bridge modules/mambots

Started by Quoth, August 04, 2006, 08:39:17 AM

Previous topic - Next topic

Quoth

After further investigation into some problems I've been having I'd like to draw my problems into one thread with better information/structure so please close this.

I am using:
Joomla! 1.0.10
SMF 1.1RC2
Bridge 1.1.5

Background Info:
In the last couple of days I've been getting some mysql errors with some of the modules and mambots which work in conjunction with the Bridge, some before and some after my upgrade from 1.1.4 to 1.1.5. Appart from this the only changes that have been made are a new index template complete with new CSS but i get these errors with the old index and css too, in the past however i didn't get these errors even with my old theme. Another change made which i believe started these problems was the uninstallation of a module (i cant remember which, thats the annoying part) as these errors only started once id uninstalled something i think as i was clearing out mambots and modules i thought to be unnecessary.

Relevant Components/Modules/Mambots i currently have installed:
[C]Simple Machines Forum Registration - New Bridge 1.1.5
[C]SMF Bridge - New Bridge 1.1.5
[Mo]mod_smf_events - from here link
[Mo]mod_smf_login - From here link
[Mo]mod_smf_online2 - From here link
[Mo]mod_smf_recentTopics - From here link
[Ma]SMFAuthorBot - From here link
[Ma]SMF_header_include - New Bridge 1.1.5

Problems:
mod_smf_events returns this error on the webpage but also displays what it should, i.e. holidays birthdays and events.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/modules/mod_smf_events.php on line 29
This didn't happen a few days ago but randomly started doing so, even with 1.1.4 of the bridge.

Here is the code 3 lines either side of the reported error:
$result = mysql_query ($sql);

$row = mysql_fetch_array($result);[b]<---Line 29[/b]

$myurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=" . $row[0]."&";

$scripturl = $myurl;


mod_smf_recentTopics returns this error on the webpage but again displays what it should still, i.e. the recent topics from my SMF forum.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/modules/mod_smf_recentTopics.php on line 27
Again this didnt happen untill a few days ago even with 1.1.4 of the bridge.

Heres the code, from 3 lines above to 3 lines below
mysql_select_db($mosConfig_db);
$sql = "SELECT id FROM ".$mosConfig_dbprefix."menu WHERE link='index.php?option=com_smf'";

$result = mysql_query ($sql);

$row = mysql_fetch_array($result);[b]<--Line 27[/b]

$myurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=" . $row[0]."&";

$scripturl = $myurl;


SMFAuthorBot is something i've only tried since i installed 1.1.5 but i get the following errors, however this dosnt do as it should even when displaying the errors when i unpublish the mambot the feature works for a limited time and then is actually turned off.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/mambots/content/SMFAuthorBot.php on line 39

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/username/public_html/mambots/content/SMFAuthorBot.php on line 45


Heres the code block containing both errors with some leading and trailing code:
$sql = "SELECT id FROM ".$mosConfig_dbprefix."menu WHERE link='index.php?option=com_smf'";
$result = mysql_query ($sql);
if (isset($result))
$smfid = mysql_fetch_array($result);[b]<--Line 39[/b]
$smf_authorurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=".$smfid[0];

mysql_select_db($db_name);
// Get the id of the Author
$result = mysql_query ("SELECT `ID_MEMBER` FROM {$db_prefix}members WHERE realName = '". ($row->created_by_alias!='' ? $row->created_by_alias : $row->author)."'" );
if(list($smf_userid) = mysql_fetch_row($result))[b]<--Line 45[/b]
{
// Print url to user's profile
$row->created_by_alias='<a href="'.sefRelToAbs($smf_authorurl . '&amp;action=profile;u=' . $smf_userid).'">'.($row->created_by_alias!='' ? $row->created_by_alias : $row->author).'</a>';
}


Although the bold tags dont work within code tags they still help to illustrate the location of my errors.

All of these errors point to the instance of '$result' is this defined in something i have uninstalled or not installed?

If anyone can help me out i'll be extremely greatful as ive spent a few hours this morning searching through various mysql and php forums trying to find a solution as well as searching here and over at joomla!, getting quite frustrated by it all as i cant find a solution and i get the feeling its something painfully obvious or very easy to solve.

Again any help is much appreciated and if more information may be needed please just inform me and i'll include it.

Kind Regards,
Quoth

Orstio

QuoteProblems:
mod_smf_events returns this error on the webpage but also displays what it should, i.e. holidays birthdays and events.

Does that go away if you add $database to the list of globals on line 25?


Quoth

Quote from: Orstio on August 04, 2006, 09:25:10 AM
QuoteProblems:
mod_smf_events returns this error on the webpage but also displays what it should, i.e. holidays birthdays and events.

Does that go away if you add $database to the list of globals on line 25?


Nope, same error :(

Kindred

where is the events module in the module list?

I have all of these modules (and all the others) installed and working correctly on my tets site and several live sites.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Orstio

Are you certain that your SMF database user has access to your Joomla database?

That check is to find your main menu link to the bridge component.  Did you delete the link in the main menu, or perhaps try moving it to another menu?

Quoth

I dont know quite what you mean Kindred but heres a view of my module order linky.

SMF DB deffinetly has access as these modules worked previously and i ensured this was the case on installing the bridge ages ago. Didnt move the forum link but after uninstalling the old bridge and installing the new one the id of the bridge has changed - would this have an effect?

Orstio


Quoth

Same thing, i've cleared caches etc aswell.

Do i need any other component/module aswell as the bridge for bridge modules to work? as i only have the ones mentioned above.

Orstio

No, that should be all you need.

You haven't unpublished the SMF_Header_include bot have you?

Quoth

It's published, always has been.

This is quite a puzzeler! if you want i can set you up with admin rights if it may help.

Quoth

Do you want me to set up an admin rights account for your Orstio or is there any other suggestions for a fix?

Quoth

I've still not been able to find a solution to these issues which are continuously frustrating as it's slowed down my new development almost completely, i've been searched various SMF, php/mysql and Joomla forums to try and find some sort of answer to no luck - does anyone have any idea on how to fix my errors?

Any help greatly appreciated, i appologise for the bump but this is quite a large problem.

Advertisement: