OK, I solved this problem, but the solution requires a bit of PHP hacking. If you are new to scripting, don't get too freaked. If you follow the set of steps below you should get to a working random picture block.
The underlying problem, as noted by the first person who started this thread and myself later is that the database that is currently open when this script is working is not the coppermine db, but the postnuke db. I think the author of the script set it up to connect user accounts of PN and Coppermine, so the first db needed to be open. The problem lies in that the Coppermine db is not opened and so the queries to get the pics can't access the Coppermine db. I want a simple random pic to appear in my postnuke site taken from a coppermine photo gallery. So I have to add to his/her script the two lines of code to open the Coppermine database.
1. OK, let's get started. First go to your mysql area for your hosting control panel Hopefully you are using Cpanel because this is what I am basing this step on. Add a new user to mysql. Add this new user to your coppermine database (which is named _____copp1 - fill in the blank from what you see in Cpanel). Write down the full coppermine database name, full username and pw.
2. Open the file /modules/pnCPG/pnblocks/pncpg-random.php - ftp a copy from your web site.
Add in the following lines, noted in red around the other code, which starts about line 95 +/- of the script. replace stuff noted between "{...}" with your information, removing the "{ } " brackets as well.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (!cur_logged) {
$view_list="0" ;
} else {
$db_new=mysql_connect("localhost", {full username you just created}, {password you just created}) or mysql_error();
mysql_select_db("full name of your coppermine database",$db_new) ;
$view_list="0" ;
$query0= "select user_group,user_id from $cpgprf"._users." where user_name= '$cur_usr'";
$result0 = mysql_query($query0) or die("Query0 stupid failed : " . mysql_error());
$num_rows = mysql_num_rows($result0);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. Save the file, ftp it up to your server, replacing the original on your server.
4. Now the block should work. Edit the options noted by the original author of this block normally.
I hope this helps others....