Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Error on last albums plugin!  (Read 1593 times)

0 Members and 1 Guest are viewing this topic.

alexndrre

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Error on last albums plugin!
« on: June 06, 2016, 02:31:36 am »

Hello, I am using a plugin which displays the last albums uploaded in the gallery on your website.

But it displays this following message:

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u467224226/public_html/galeria/api.php on line 11

Warning: mysql_connect(): Access denied for user 'u467224226_yjygu'@'10.1.2.19' (using password: YES) in /home/u467224226/public_html/galeria/api.php on line 11
Could not connect: Access denied for user 'u467224226_yjygu'@'10.1.2.19' (using password: YES)

Below, the following code. Can anyone save me?

<?php
   require_once('include/config.inc.php');
   header("Content-type: application/x-javascript");
   
   
      
   $connect = mysql_connect($CONFIG['dbserver'],$CONFIG['dbuser'],$CONFIG['dbpass'])
      or die('Erro ao conectar ao servidor');
   $connect_db = mysql_select_db($CONFIG['dbname'], $connect)
      or die ('Erro ao conectar ao banco de dados');
         
            
            $resultado = mysql_query("SELECT * FROM `cpg_albums` ORDER BY `cpg_albums`.`aid` DESC LIMIT 0 , 4", $connect)

               or die('Nenhum album encontrado com esta query');
                                       
               echo 'document.write(\'';
               
               if(mysql_num_rows($resultado) == 0){
                  echo 'Nenhum álbum cadastrado';
               } else {
echo '<section id="ultimas_fotos">  ';
                  while($row = mysql_fetch_array($resultado)){
                     echo ' ';
                        $album_id = $row['aid'];
                        $subresult = mysql_query("SELECT * FROM `cpg_pictures` where aid=$album_id order by pid DESC LIMIT 0, 20");
                        
                        if(mysql_num_rows($subresult) == 0){
                           $album_img = "http://tisdalephotos.com/images/thumbs/thumb_nopic.png";
                        } else {
                           while($subrow = mysql_fetch_array($subresult)){
                              $album_img = "http://tisdalephotos.com/albums/".$subrow['filepath'].'thumb_'.$subrow['filename']  .$subrow['datebrowse'];
                                                                               
                           }
                        }
                        
                        echo '<div id="ultalb"><a href="http://tisdalephotos.com/thumbnails.php?album='.$album_id.' "><img src="'.$album_img.'" alt="" /></a><div id="ultalbt"><a href="http://tisdalephotos.com/thumbnails.php?album='.$album_id.' ">+</a></div></div>';   
                        
                     echo '';
                  }
               }

echo '</tr></section>';
               echo '\');';
            
         ?>
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Error on last albums plugin!
« Reply #1 on: June 07, 2016, 10:39:30 am »

There are 2 issues:

1. usage of deprecated mysql functions
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/u467224226/public_html/galeria/api.php on line 11

2. insufficient permissions to access the database:
Warning: mysql_connect(): Access denied for user 'u467224226_yjygu'@'10.1.2.19' (using password: YES) in /home/u467224226/public_html/galeria/api.php on line 11
Could not connect: Access denied for user 'u467224226_yjygu'@'10.1.2.19' (using password: YES)


To fix issue 1) either use mysqli or PDO instead of mysql functions, or set your web server to not display deprecated warning messages (I recommend the first option!).

To fix issue 2) please check the credentials and the MySQL permissions of that MySQL user.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.