Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: MySQL Assist  (Read 2556 times)

0 Members and 1 Guest are viewing this topic.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
MySQL Assist
« 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. 

Code: [Select]
<?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?
« Last Edit: April 02, 2007, 08:39:41 am by GauGau »
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: MySQL Assist
« Reply #1 on: March 30, 2007, 06:39:24 pm »

Solved - changed 'mysql_query' to 'cpg_db_query'.
Pages: [1]   Go Up
 

Page created in 0.012 seconds with 15 queries.