forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 modpack by Stramm => Topic started by: darkpollo on July 27, 2008, 11:14:56 pm
-
Hi. I have got this old problem:
http://forum.coppermine-gallery.net/index.php/topic,37583.0.html
While executing query "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid, u.avatar AS avatar_url FROM cpg14x_comments AS c LEFT JOIN `motos_smf`.smf_members AS u ON c.author_id=u.ID_MEMBER WHERE pid='382' ORDER BY c.msg_id ASC" on Resource id #25
mySQL error: No database selected
Fichero: /home/motos/public_html/galeria/include/functions.inc.php - Línea: 248
Coppermine install:
http://www.todo-motos.es/galeria
Forum install: http://www.todo-motos.es/foros
Coppermine version: 1.4.18(stable)
Forum version: SMF 1.1.5
Test user account: test2 / testtest
URL del foro: http://www.todo-motos.es/foros
ruta relativa de su archivo de configuración de la aplicación BBS's: ../foros/
¿Usar grupos basados en POST?: 0
Path where avatars are stored: avatars
Habilitar/deshabilitar integración con Simple Machines (SMF) 1.x
I have updated to the latest modpack as you suggest on the other topic with no solution.
Thanks
-
I have setup a plugin to avoid the error but you can check it here:
http://www.todo-motos.es/galeria/displayimage.php?album=20&pos=2
-
Any news to that error?
Cause the plugin only jumps over it, but something is still broken on the web.
Thanks.
-
Please, nobody knows how to help me?
Do you need more info?
Thank you.
-
Look in bridge/udb_base.inc.php for this
function get_comments($pid, $comment_sort_order)
{
global $CONFIG;
if ($this->can_join_tables) {
$sql = "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid, u.{$this->field['avatar_url']} AS avatar_url FROM {$CONFIG['TABLE_COMMENTS']} AS c LEFT JOIN {$this->usertable} AS u ON c.author_id=u.{$this->field['user_id']} WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order";
$result = cpg_db_query($sql, $this->link_id);
return $result;
} else { //no join -> we do not get the avatar URL and if needed we need to get it later on in another query
$sql = "SELECT c.msg_id, c.msg_author, c.msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, c.author_id, c.author_md5_id, c.msg_raw_ip, c.msg_hdr_ip, c.pid FROM {$CONFIG['TABLE_COMMENTS']} AS c WHERE pid='$pid' ORDER BY c.msg_id $comment_sort_order";
$result = cpg_db_query($sql);
return $result;
}
}
and try changing
$result = cpg_db_query($sql, $this->link_id);
to
$result = cpg_db_query($sql);
-
It works!
Thank you very much!