Well unfortunatly is it in a phpbb script.
What is the best way to fix this?
Here is the block affected
function get_sub_cat($cat_main, $catrow )
{
global $db;
if ($cat_main > 0)
{
// lire les rubriques dépendantes
$sql= "SELECT * FROM ".CATEGORIES_TABLE." WHERE cat_id <> $cat_main AND cat_main=$cat_main";
if( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie sons '.$sql, '', __LINE__, __FILE__, $sql);
while ( $catw = $db->sql_fetchrow($result) )
{
// ajouter la catégorie
$i = count($catrow);
$catrow[$i] = $catw;
// aller chercher les sous-catégories
if ($catw['cat_id'] > 0) $catrow = get_sub_cat($catw['cat_id'],$catrow);
}
}
return $catrow;
}
// build sorted cats array
function get_cat($cat_id)
{
global $db;
// vérifier la catégorie
if ($cat_id <= 0) $cat_id = -1;
if ($cat_id > 0)
{
$sql = "SELECT * FROM " . CATEGORIES_TABLE . " WHERE cat_id=$cat_id";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query this categories', '', __LINE__, __FILE__, $sql);
if ( !($row = $db->sql_fetchrow($result)) ) $cat_id = -1;
}
thankyou! 😃