Hi,
I’m using Maxigallery to display a random image on my homepage (my call is :
[!MaxiGallery? &gal_query_ids=`all` &order_by=`random` &limit=`1`!])
and I’ve got the following MySQL problem (others home-made snippets are present on my homepage
and use the same database):
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: mysql_query(): Can’t connect to local MySQL server through socket ’/var/lib/mysql/mysql.sock’ (2)
Error type/ Nr.: Warning - 2
File: /hsphere/local/home/french/srfc.frenchwill.fr/assets/snippets/maxigallery/maxigallery.php
Line: 241
Line 241 source: $query=mysql_query("DESC $mg->pics_tbl");
Any idea of what I can do to solve it ?
So other snippets are querying the database fine, but not maxigallery?
also see
this...
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
The problem is that MaxiGallery works fine on a page with no other snippets, but cause this error
when called on the homepage. I don’t understand.
Do you have some snippets on the page that use another database by any chance?
This can cause some problems.. see:
http://wiki.modxcms.com/index.php/Access_another_database_from_MODx
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
No, all the tables (maxigallery, modx and others) are in the same database.
Hmm.. I don’t have a clue what’s causing it then.
What other snippets you have running on the same page? Have you tried to pinpoint what causes these errors by disabling all other snippets and enabling them one by one..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Well.. to me it seems that after your snippets are run, the database cannot be queried through MODx api. So.. I guess there’s something wrong in your snippets and specifically the way you access database. But these are just guesses.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Yes, thanks a lot, your guesses were right !
The problem was the use of mysql functions instead of the modx api to access the database.
(the code for the snippets were imported from a old non-modx site).