Errors in mysql.php

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
Honzazi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 113
Joined: Wed Jan 17, 2007 4:30 pm

Errors in mysql.php

Post by Honzazi » Fri Jan 23, 2009 2:43 pm

I have this error hat shows on the top of the page in firefox and doesn't shows up in IE..

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/public_html/libraries/joomla/database/database/mysql.php on line 359 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/public_html/libraries/joomla/database/database/mysql.php on line 362

What is that? Should I reload the database????
I'm lost! Please help

Thank you!
Last edited by dam-man on Thu Jan 29, 2009 4:20 pm, edited 1 time in total.
Reason: Removed all Capitals

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: PLEASE HELP! ERRORS in mysql.php

Post by dam-man » Fri Jan 23, 2009 3:06 pm

Is this a new install?
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

Honzazi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 113
Joined: Wed Jan 17, 2007 4:30 pm

Re: PLEASE HELP! ERRORS in mysql.php

Post by Honzazi » Fri Jan 23, 2009 7:30 pm

Well, yes, but I have spent two days to install other things too... simply because I knew what I need. It would be crazy if I have to do it again! ;(

Thanks for any idea :)

Honzazi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 113
Joined: Wed Jan 17, 2007 4:30 pm

Re: PLEASE HELP! ERRORS in mysql.php

Post by Honzazi » Sat Jan 24, 2009 10:55 pm

Hi, I reinstall the site... seems to be ok now...
Thanks

just_chris
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sat Jan 17, 2009 8:18 pm

Re: PLEASE HELP! ERRORS in mysql.php

Post by just_chris » Thu Jan 29, 2009 4:00 pm

sorry to hijack this but i have the same problem ( well similiar one) Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/public_html/joomla/libraries/joomla/database/database/mysql.php on line 342

when using $db->getNumRows(); when using it like this and with a the $result parameter. I dont get it.

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: PLEASE HELP! ERRORS in mysql.php

Post by dam-man » Thu Jan 29, 2009 4:19 pm

just_chris wrote:sorry to hijack this but i have the same problem ( well similiar one) Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/public_html/joomla/libraries/joomla/database/database/mysql.php on line 342

when using $db->getNumRows(); when using it like this and with a the $result parameter. I dont get it.
Mod Note: Please don't hijack anothers post.

getNumRows() is not used in Joomla! You need to do this another way. When picking up all data with a query like below:

Code: Select all

$sql = "Your query goes here..";
$db->setQuery($sql);
$this->data = $db->loadObjectList();
You can do the next thing to get the number of rows:

Code: Select all

$countrows = count($this->data);
echo $countrows;
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

just_chris
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sat Jan 17, 2009 8:18 pm

Re: Errors in mysql.php

Post by just_chris » Thu Jan 29, 2009 5:05 pm

Thank you. sorry for that, i figured his issue was resolved so it would be cool. anyhow getNumRows is in the API at http://api.joomla.org/Joomla-Framework/ ... getNumRows which is why i was using all this time.

Thank you for summing it up for me.

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: Errors in mysql.php

Post by dam-man » Thu Jan 29, 2009 6:41 pm

It wasn't working for me either...
So this is also a good option to use :-)
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

User avatar
guilliam
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4181
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: Errors in mysql.php

Post by guilliam » Mon Feb 16, 2009 4:03 am

could this be a cache issue?

im having this issue too:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 359

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 362

- g
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.

http://www.joomlaconsultancy.net

rodsdesign
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Tue Apr 17, 2007 2:11 pm

Re: Errors in mysql.php

Post by rodsdesign » Mon Feb 16, 2009 8:31 pm

I'm having this issue also... really strange... I have 2 dozen Joomla sites - this is the only one it does it on... (and not all the time)

http://www.christiansecuritynetwork.org

any thoughts?

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: Errors in mysql.php

Post by dam-man » Tue Feb 17, 2009 11:30 am

guilliam wrote:could this be a cache issue?

im having this issue too:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 359

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 362

- g
mysql_fetch_row() is not supported in Joomla! You should use this:

Code: Select all

$sql = "Your query goes here..";
$db->setQuery($sql);
$this->data = $db->loadObjectList();
this->data has now the same value as mysql_fetch_row()
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

rodsdesign
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Tue Apr 17, 2007 2:11 pm

Re: Errors in mysql.php

Post by rodsdesign » Tue Feb 17, 2009 2:12 pm

Hi,

thanks for your reply.

this is a straight 1.5.9 install - I haven't changed any files at all... :(

i'm running:
Community Builder (latest)
Virtuemart (latest)
Fireboard (latest - in legacy mode)
SH404

and I've turned cache off in both the main config file and SH404...

very confusing :(
thanks

User avatar
guilliam
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4181
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

Re: Errors in mysql.php

Post by guilliam » Tue Feb 17, 2009 4:23 pm

dam-man wrote:
guilliam wrote:could this be a cache issue?

im having this issue too:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 359

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
libraries/joomla/database/mysql.php on line 362

- g
mysql_fetch_row() is not supported in Joomla! You should use this:

Code: Select all

$sql = "Your query goes here..";
$db->setQuery($sql);
$this->data = $db->loadObjectList();
this->data has now the same value as mysql_fetch_row()
same as above post. its a 1.5.9 install with Fireboard/Kunena, CB.
there was no modifications on the joomla code.

- g
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.

http://www.joomlaconsultancy.net

scubastevelg
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Feb 21, 2009 12:16 pm

Re: Errors in mysql.php

Post by scubastevelg » Sat Feb 21, 2009 12:24 pm

This is the code effected by this problem and is in /libraries/joomla/database/database/mysql.php


error reports
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in D:\Prod_Webfolder\libraries\joomla\database\database\mysql.php on line 359

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in D:\Prod_Webfolder\libraries\joomla\database\database\mysql.php on line 362

this is a snippet of the original code from lines 353 - 364
i added the numbers to the code for ease of reference!!

Code: Select all

353	function loadResult()
354	{
355		if (!($cur = $this->query())) {
356			return null;
357		}
358		$ret = null;
359		if ($row = mysql_fetch_row( $cur )) {
360			$ret = $row[0];
361		}
362		mysql_free_result( $cur );
363		return $ret;
364	}


so how would i change this so that it works right i see you got a fix there but unsure how to impleament it i tried a couple of thing with it but keep getting blank pages with errors

a little back ground on this problem:
okay it only does this after i login and select remember me then close out my browser and then reopen it, then it throws the above error!! But..............
all i have to do is hit on home again on my site and the error clears and everything works normal, sometimes i have to do it more then once.
close out of the browser and here we go again........
Oh and it doesn't matter if the cache is on or off it still does this....

So if what i hear you saying is true joomla doesn't know how to use mysql_fetch_row or mysql_free_result why does the error clear after tapping Home a few times....
i would think the error would be there regardless if joomla didn't support it or i have something installed suppressing my error logs so they only show once that i didn't know about.....

nsprime
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Feb 15, 2006 1:15 pm

Re: Errors in mysql.php

Post by nsprime » Mon Feb 23, 2009 2:12 pm

That is exactly what is happening to my site. Solution anyone?

scubastevelg
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Feb 21, 2009 12:16 pm

Re: Errors in mysql.php

Post by scubastevelg » Mon Feb 23, 2009 2:58 pm

This what i have managed to come up with but still get errors with the mysql_free_result
error code:
Parse error: parse error, expecting `T_FUNCTION' in D:\Prod_Webfolder\libraries\joomla\database\database\mysql.php on line 364

still no where near a fix but im getting closer i think

Code: Select all

	function loadResult()
	{
		if (!($cur = $this->query())) {
			return null;
		}
		$ret = null;
		if ($sql = ($cur));
		$db->setQuery($sql);
		$this->data = $db->loadObjectList ($cur);
			$ret = $row[0];
     }
		mysql_free_result ( $cur );
		return $ret;
	}

do not use this code i put in this post above it will break your site!!

i'm trying to help work thru this problem maybe someone else will see something im missing

Tom0
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Nov 20, 2008 10:17 am

Re: Errors in mysql.php

Post by Tom0 » Mon Apr 13, 2009 9:06 am

Has anyone got any further on this problem? I have been turning a blind eye to it while in development but now could really do with sorting it out. It only seems to happen in internet explorer (go figure..) when you first open the page.

Strange as ff doesnt remember me after i close the browser so when i go back to the site it just goes to the homepage, but ie keeps me logged in even the next day but gives these errors at the top. at least until i refresh the page, then it is fine.

viju
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Aug 13, 2008 11:37 am

Re: Errors in mysql.php

Post by viju » Tue Jun 02, 2009 2:08 pm

Hi even i am having the same issue:

Here are the details:

Joomla-Version 1.5.3

When i upload a video file through " My Videos" plugin in CB i get the below error

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/xxxxxx/public_html/wemgola_com/acc/libraries/joomla/database/database/mysql.php on line 456

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/xxxxx/public_html/wemgola_com/acc/libraries/joomla/database/database/mysql.php on line 463

along with the success message:
"Your Video File has uploaded successfully
seyretfiles/uploads/videos/user_226/176_SecretarysA-sss.flv"

What i should do? even the errors are set to "None" in the configuration page.

the code is below:
$db = &JFactory::getDBO();
$db->setQuery("INSERT INTO `#__seyret_items` ( `id` , `catid` , `title` , `itemcomment` , `videoservertype` , `videoservercode` , `picturelink` , `ordering` , `hit` , `votetotal` , `voteclick` , `addedby` , `addeddate` , `published` , `downloadcount` , `accesslevel` , `hasbackup` , `isdownloadable` , `backupid` , `videourl` , `featured` , `fbthread` , `videotags` , `lastclicktime` , `playtime` , `isreplyto` ) VALUES (NULL , '', '$title' , '$itemcomment' , 'localfile' , '$smallvideocode' , NULL , NULL , '', '', '', '$uid', '$date', '1', NULL , '0', NULL , '1', '0', NULL , '0', '0', '$videotags' , '0000-00-00 00:00:00', NULL , '0')");
$row = $db->loadObject();

Danieluww
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Sep 10, 2008 4:46 pm
Contact:

Re: Errors in mysql.php

Post by Danieluww » Fri Jan 28, 2011 4:16 pm

Has anyone figured out how to resolve this issue? I have this on a website with Joomla 1.5.15 installed.

This only occurs when I enable the banner module.


UPDATE*
I've updated the website to Joomla 1.5.22 but still have the same error.

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/shalimar/public_html/commercial/libraries/joomla/database/database/mysql.php on line 359

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/shalimar/public_html/commercial/libraries/joomla/database/database/mysql.php on line 362

This only occurs on pages where I display the banner module
Purchase Your Domain Name
http://www.yourdomainpick.com

justIT
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Oct 12, 2006 1:23 pm

Re: Errors in mysql.php

Post by justIT » Fri Jan 28, 2011 9:08 pm

Has someone submitted this as a bug? Form was working and all of a sudden running J! 1.5.22 same exact error on form submission:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/shalimar/public_html/commercial/libraries/joomla/database/database/mysql.php on line 359

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/shalimar/public_html/commercial/libraries/joomla/database/database/mysql.php on line 362

Is this a memory leak? Tried on Firefox, Chrome and Safari, same error.

No point hiding the error in php.ini because form inserts into mysql table a value of 0

Tobes
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Nov 30, 2007 11:14 am

Re: Errors in mysql.php

Post by Tobes » Fri Feb 04, 2011 5:16 am

hhmm I just reinstalled the software component where this error message appeared and it worked fine, it seems on install there was some database tables missing, reinstalling added the tables that were missing and all is working fine now.

:pop

User avatar
yae
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Sun Jul 12, 2009 6:03 pm

Re: Errors in mysql.php

Post by yae » Tue Oct 04, 2011 8:51 am

I am using 1.5.23 version and I have the same errors:

Code: Select all

PHP Warning:  mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /usr/home/xxxxxxxxxxxxxxxx.es/web/libraries/joomla/database/database/mysql.php on line 359
PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /usr/home/xxxxxxxxxxxxxxxx.es/web/libraries/joomla/database/database/mysql.php on line 362
any idea?
Regards

diastasi
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Feb 08, 2010 3:47 pm
Location: Greece
Contact:

Re: Errors in mysql.php

Post by diastasi » Thu Oct 06, 2011 6:14 am

Yeap.. I have the same issue here about
mysql.php on line 359
mysql.php on line 362

Any ideas?
http://diastasigr.com Diastasi Graphics


Locked

Return to “Joomla! 1.5 Coding”