Database query error Database query error
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Database query error

Started by Bazzah, January 19, 2007, 04:45:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bazzah

I recently noticed that when listing images in a SUB category by last uploaded or last commented, you were unable to click the thumbnail to view the intermediate image, as you would get the following error:

Fatal error: Call to undefined function: db_query() in /home/hiresco1/public_html/gallery/displayimage.php on line 259

I don't know anything about php, so I messed around to try and get it working. After removing line 257:

$res = db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$CURRENT_PIC_DATA['pid']}' AND author_id = ".USER_ID);

it worked perfectly. Obviously I am a bit concerned about removing code, as I do not know what else it will affect. Can anyone help me?

Nibbler

That is 1.3 code. Why is it in your 1.4 gallery? Replace displayimage.php with a clean copy from the download package.

Bazzah

Thanks for the reply. I have no idea why it is in there. I will replace it. Thanks

Bazzah

 ;D Thanks. Works perfectly now!

Nibbler

If you updated your gallery from 1.3 to 1.4 then there may be other old files, use versioncheck.php.