<?php include '../php/query.php'; $database = connect(); $res = $database->select("scout", ['idscout', 'varie']); var_dump($database->error()); foreach ($res as $r) { if (isset($r['varie']) and $r['varie'] != "") { insertCommento(7, $r['idscout'], 'Vecchi commenti', $r['varie']); } }
<?php include 'query.php'; if (!isLogged()) { die("Non sei loggato"); } $idUser = getId(); $idScout = $_POST['id']; $titolo = $_POST['titolo']; $commento = $_POST['commento']; insertCommento($idUser, $idScout, $titolo, $commento); echo 201;