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: Random Picture Block  (Read 6456 times)

0 Members and 1 Guest are viewing this topic.

stefanlo

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • http://www.lo-giudice.de
Random Picture Block
« on: October 22, 2003, 03:38:27 pm »

Hi !

I've got a problem building an "Last Picture Block". I always get this message:

mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/ww6165/html/blocks/block-Last_pictures.php on line 39

Is there anybody outthere who may help me? I can't fnd a soution...

Thanks in Advance

Stefan :?:  :?:
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Random Picture Block
« Reply #1 on: October 22, 2003, 07:06:37 pm »

global $prefix, $dbi;
$result = sql_query("SELECT pid, filepath, filename FROM cpg_pictures ORDER BY pid DESC LIMIT $length", $dbi);
if (mysql_num_rows($result) <= 0) {

i'm interested in your $result = sql_query() line so post it here
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

stefanlo

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • http://www.lo-giudice.de
Random Picture Block
« Reply #2 on: October 23, 2003, 08:08:49 am »

Here it is (and a little bit more..). In the Subject i wrote "Random Picture Block" but i should be "Last Picture Block". Sorry.

$result = sql_query("SELECT pid, filename FROM nuke_CPGpictures ORDER BY pid DESC LIMIT $length", $dbi);

        if (mysql_num_rows($result) <= 0) {
        $content = "No pictures...";
                return false;
        }

        while ($row = mysql_fetch_array($result)) {
                $content .= "<a href=\"modules.php?name=coppermine&file=displayimage&album=lastup&pid={$row['pid']}\">" . truncate_string3($row['filename']) . "</a><br>\n";
        }

$content .= "<center><a href=\"modules.php?name=coppermine\">Go to gallery</a></center>";
?>

Thanks for your help !

Stefan
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Random Picture Block
« Reply #3 on: October 23, 2003, 08:20:54 am »

Code: [Select]
FROM nuke_CPGpictures that's the wrong table.
it must be cpg_pictures or did you alter the database table names ?
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

stefanlo

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • http://www.lo-giudice.de
Random Picture Block
« Reply #4 on: October 23, 2003, 09:21:22 am »

ok, now I've got a listing of the last pictures, but if click on a link of these pictures, the coppermine gallery is telling me, that the picture or the album isn't there.

Stefan
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 19 queries.