coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 bridging => Topic started by: rphMedia on March 30, 2007, 03:34:53 PM

Title: MySQL Assist
Post by: rphMedia on March 30, 2007, 03:34:53 PM
I have 4 CPGs and this code works on 3 of them.  The only difference with the 4'th Gallery is it's bridged with phpBB2 and this code doesn't work at all. 

<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
$result mysql_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE filename LIKE '%.jpg' ORDER BY RAND() LIMIT 5");
while (
$row mysql_fetch_array($result)) 
{
$type max($row['pwidth'], $row['pheight']);
$list .= get_pic_url($row$type) . "<br>";
}
echo 
$list;
?>


Just trying to pull out and display 5 random relative pic links.  Any [obvious] reason it doesn't work with a bridged gallery or do I have another issue?
Title: Re: MySQL Assist
Post by: rphMedia on March 30, 2007, 06:39:24 PM
Solved - changed 'mysql_query' to 'cpg_db_query'.