Thread Starter
Anonymous
What version of WordPress are you using?
There are only 3 fields in the select but the query asks a sort on the fifth !
So….in the plugin source, you should update or remove the “order by”.:
$wpdb->query(‘SELECT filepath, filename, title FROM ‘.CPG_TABLE_PREFIX.’pictures WHERE aid=’.$aid.’ ORDER BY ‘.$aid.’ LIMIT 1 OFFSET ‘.($pos – 1));
$wpdb->query(‘SELECT filepath, filename, title FROM ‘.CPG_TABLE_PREFIX.’pictures WHERE aid=’.$aid.’ ORDER BY 3 LIMIT 1 OFFSET ‘.($pos – 1));
to sort on the title
Thread Starter
Anonymous
hey idahocline, I took a look at the code and what you posted there is what it already says in line 89… or where am I supposed to replace it?
I also tried the psnGallery.php hack, but that gave me even worse errors… I really want to have something like this 🙁
Thread Starter
Anonymous
Ok, I put this in line 89 $wpdb->query('SELECT filepath, filename, title FROM '.CPG_TABLE_PREFIX.'pictures WHERE aid='.$aid.' ORDER BY 3 LIMIT 1 OFFSET '.($pos - 1));
but I am still getting an error:
SQL/DB Error:
[You have an error in your SQL syntax near ‘OFFSET 4’ at line 1]
SELECT filepath, filename, title FROM pix_pictures WHERE aid=5 ORDER BY 3 LIMIT 1 OFFSET 4
Well, if you take the code from the link you wrote above, the code to update is indeed at line 98. But the code is :
$wpdb->query(‘SELECT filepath, filename, title FROM ‘.CPG_TABLE_PREFIX.’pictures WHERE aid=’.$aid.’ ORDER BY ‘.$aid.’ LIMIT 1 OFFSET ‘.($pos – 1));
and not
$wpdb->query(‘SELECT filepath, filename, title FROM ‘.CPG_TABLE_PREFIX.’pictures WHERE aid=’.$aid.’ ORDER BY 3 LIMIT 1 OFFSET ‘.($pos – 1));
What problems have you encountered with “psnGallery” ?
Thread Starter
Anonymous
I’ll reinstall the psngallery hack and show you, give me a sec.
Thread Starter
Anonymous
btw, the $wpdb->query('SELECT filepath, filename, title FROM '.CPG_TABLE_PREFIX.'pictures WHERE aid='.$aid.' ORDER BY 3 LIMIT 1 OFFSET '.($pos - 1)); is still not working. but yeah, let me do the psngallery thing, you’ll see.
Thread Starter
Anonymous
Ok, got it, pleas go here and have a look: http://www.riding-shotgun.de/blog/
let’s continue per mail….At first look, it seems that you haven’t configured correctly the module….
I am at work for the moment. But I have finished in 4 or 5 hours I will be at home. Send me a mail with your version of psnGallery.php. I will have a look. (admin at idahocline dot com)
While executing query “SELECT * FROM dbname.cpg11d_config” on 0
mySQL error: Access denied for user: ‘v109938@localhost’ to database ‘dbname’
dbname is the variable name the module.
cpg11d is the default value….
Thread Starter
Anonymous
That’d be so nice, because I would rather have this hack, I liked the way it works better, but I am blind when it comes to code. I will send you the file.
Thanks so much!
at the end of the code, you should find :
// MySQL configuration
$CONFIG[‘dbserver’] = “localhost”; // Your database server
$CONFIG[‘dbuser’] = “user”; // Your mysql username (v109938 I assume)
$CONFIG[‘dbpass’] = “password”; // Your mysql password
$CONFIG[‘dbname’] = “dbname”; // Your mysql database name
$CONFIG[‘urlsite’] = “http://gallery.idahocline.com”;
// MySQL TABLE NAMES PREFIX
$CONFIG[‘TABLE_PREFIX’] = $CONFIG[‘dbname’].”.cpg11d_”;
So update those entries according yours…. Don’t forget to change “cpg11d_” into “pix_” (I assume, according your error message
Thread Starter
Anonymous
ok, so now I have this:
// MySQL TABLE NAMES PREFIX
$CONFIG['pix_'] = $CONFIG['dbname']."pix_";
but still get this:
While executing query “SELECT * FROM dbname.cpg11d_config” on 0
mySQL error: Access denied for user: ‘v109938@localhost’ to database ‘dbname’
I’m frustrated 🙁
the update you have to update the values not the “identificators”
$CONFIG[‘dbserver’] = “localhost“; // Your database server
$CONFIG[‘dbuser’] = “user“; // Your mysql username (v109938 I assume)
$CONFIG[‘dbpass’] = “password“; // Your mysql password
$CONFIG[‘dbname’] = “dbname“; // Your mysql database name
$CONFIG[‘urlsite’] = “http://gallery.idahocline.com“;
// MySQL TABLE NAMES PREFIX
$CONFIG[‘TABLE_PREFIX’] = $CONFIG[‘dbname’].”cpg11d_“;
Sorry I should have been more precise….