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