Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Sql error in modules

11 years 8 months ago
Licenses:
JomSocial Expired Socialize Expired

SQL errors - sometimes its coming sometimes not and till now i saw it only in event module...
Screenshot attached
I shared the same with my webhosts
and their reply is...

"I am not seeing this error on your site.

As a PHP developer, this appears to be a coding logic issue. The mysqli_close function is being ran before it checks if the connection is still open. If this error only occasionally shows up, something is closing the MySQL connection before the function can.

Better PHP logic for this would be as follows:

$mysqlcon = mysqli_connect('127.0.0.1', 'user', password');
// code here
if($mysqlcon) // checks if connection is still open
{
mysqli_close($mysqlcon);
} // Otherwise this is skipped, hiding the error.

You can also use display_errors(0) in your code to hide the error.

For better syntax highlighting I've put this on pastebin for you below:

pastebin.com/Wdn99Nhp

Please give this a shot to see if it works."



Please advise
Regards
Saurabh

Attachments:
11 years 8 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

This is just warning error, the solution you can change the joomla configuration

#1 set error_reporting on joomla configuration to none
#2 set the mysql/database server to mysql instaed of mysqli

I hope it will help

11 years 8 months ago
Licenses:
JomSocial Expired Socialize Expired

When i changed to mysql
it gave me following error

Warning: sprintf() [function.sprintf]: Too few arguments in /home/engineeringwall/public_html/plugins/system/koowa/koowa.php on line 38

my webhost has also reported the following errors - ( he has also enabled joomla cache) hope it is fine....
You seem to have an issue with a MySQLi function as your error log is full of these errors:
[21-Feb-2015 15:28:50 Asia/Kolkata] PHP Warning: mysqli_close() [<a href='function.mysqli-close'>function.mysqli-close</a>]: Couldn't fetch mysqli in /home/engineeringwall/public_html/libraries/joomla/database/driver/mysqli.php on line 210
[21-Feb-2015 15:28:50 Asia/Kolkata] PHP Warning: mysqli_close() [<a href='function.mysqli-close'>function.mysqli-close</a>]: Couldn't fetch mysqli in /home/engineeringwall/public_html/libraries/joomla/database/driver/mysqli.php on line 210
[21-Feb-2015 15:29:08 Asia/Kolkata] PHP Warning: mysqli_close() [<a href='function.mysqli-close'>function.mysqli-close</a>]: Couldn't fetch mysqli in /home/engineeringwall/public_html/libraries/joomla/database/driver/mysqli.php on line 210
[21-Feb-2015 15:29:08 Asia/Kolkata] PHP Warning: mysqli_close() [<a href='function.mysqli-close'>function.mysqli-close</a>]: Couldn't fetch mysqli in /home/engineeringwall/public_html/libraries/joomla/database/driver/mysqli.php on line 210
[21-Feb-2015 15:29:08 Asia/Kolkata] PHP Warning: mysqli_close() [<a href='function.mysqli-close'>function.mysqli-close</a>]: Couldn't fetch mysqli in /home/engineeringwall/public_html/libraries/joomla/database/driver/mysqli.php on line 210

You should look at resolving the issue or switching to the regular MySQL interface.


Thank you and have a great day,

11 years 8 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

I already set error reporting to none right now, that error will not show anymore.

11 years 8 months ago
Licenses:
JomSocial Expired Socialize Expired

Error occurring & showing error occurring are two different points

Why that error was coming?

Do i need to switch to mysql from mysqli?

Regards
Saurabh

11 years 7 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Saurabh,

OH ya I see different 2 errors, well

#1 sprintf() issue, this issue caused by koowa plugin, this is not Jomsocial issue. I suggest you contact koowa developer for this

#2 mysqli error caused by the query result is empty so you can't fetch the data, but warning will not show if you set to mysql instead of mysqli.

thank you

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW