i don't believe that you have grabbed any information for ".$prefix."course_categories
mysql_query("UPDATE ".$prefix."course c, (SELECT id FROM ".$prefix."course_categories) cat INNER JOIN ".$prefix."course_categories cat ON c.category = cat.id SET c.visible = '1' WHERE c.category = '".$vist."' AND c.visible = '0' AND c.category <> '0'");
This code is wrong, but I believe that you need to select that information first so that you can use it.