Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: [SOLVED] blocks sql problem  (Read 3404 times)

0 Members and 1 Guest are viewing this topic.

gazraa

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
[SOLVED] blocks sql problem
« on: November 18, 2003, 11:49:43 am »

i'm using nuke 6.7 with all security patches
just installed coppermine 1.2 rc2

no problem.

i want to use the block for random pictures in the center of nuke, but it looks like the sql queries in the blocks don't use the database prefix set in the config.inc.php

i'm not a php expert, but am learning and can understand most of what the code does.

Can someone give me a hand in getting the block-center-Random_pictures.php to work

i get this error at the moment:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ###my path to the file###/block-Random_pictures.php on line 49

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ###my path to the file###/block-Random_pictures.php on line 60
Logged

RedGerry

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
SQL Statement in blocks.
« Reply #1 on: November 26, 2003, 05:11:04 pm »

The SQL statement in the block is presuming that you have the default directory cpg_pictures. If, like me, you renamed your install then you have to modify two lines of code to get this to work..

Around line 48
$result = sql_query("SELECT count(*) from nuke_cpgpictures", $dbi);

Around line 59
$result2 = sql_query("SELECT pid, aid, filepath, filename  from nuke_cpgpictures WHERE approved='YES' LIMIT $random_number,1", $dbi);

The two bits in bold are the correction for MY config where I kept the nuke prefix and stuck the cpg after the _ to keep all the cpg tables together.

Edit to suit your tables.
Logged
http://www.redgerry.com
Home of RG_Sports

gazraa

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
[SOLVED] blocks sql problem
« Reply #2 on: November 26, 2003, 05:23:16 pm »

hmmmm when I made that change for my config I get this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /path to my file/blocks/block-Random_pictures.php on line 49

any ideas?
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
[SOLVED] blocks sql problem
« Reply #3 on: November 26, 2003, 06:49:19 pm »

Upgrade to RC3 it has mass changes.
Logged
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 18 queries.