Codice PHP:
$query=mysql_query("select nome from videogiochi");

$path="videog"// la cartella che contiene tutte le cartelle che devi creare
while ($res=mysql_fetch_assoc($query)) mkdir($path."/".$res['nome'],0777);