Der Code sieht so aus:
$var_visible = "1";
$var_status = "visible";
$sql = "SELECT folder_name.id FROM folder_name WHERE folder_name.visible = ".$var_visible." AND folder_name.status = ".$var_status."";
echo $sql;
$dir = mysql_query($sql);
echo $dir;
Gruß ... der Simon