Buon giorno, ho delle news sulla prima pagina ordinate in base ad un mio criterio, in pratica decido quale deve comparire per prima, seconda, terza etc etc....
Però vorrei capire quale struttura adottare per far in modo di poter cambiare l'ordine di visualizzazione.
L'attuale struttura è la seguente:
In pratica, per ogni news scelgo la nuova posizione di visualizzazione attraverso la select NuovaPosizioneNews, dopodichè, cliccando su Conferma dovrebbe aggiornarmi in un sol colpo tutte le news interessate...codice:$sqlIdNews = "select distinct nIdNews, cTitolo, dDataIns, PosizioneNews from TBNEWS where PosizioneNews <> 0 order by dDataIns DESC limit 10"; $rsIdNews= cExeQuery($sqlIdNews, $Connessione) or die("Impossibile connettersi!"); echo " <form method='post' action='UpdateNews.php' enctype='multipart/form-data'> <?php if (nNumRows($rsIdNews) > 0) { while ($cRiga = cFetchAssoc($rsIdNews)) { $nIdNews = $cRiga['nIdNews']; $cTitolo = htmlentities($cRiga['cTitolo']); $dDataIns = $cRiga['dDataIns']; $PosizioneNews = $cRiga['PosizioneNews']; echo "<hr/><p class='max'>Data Inserimento: ". cGiraData($dDataIns,DBHTML)."</p>"; echo "<p class='max'>Titolonews: <input type='text' id='cTitolo' name='Ctitolo' value='$cTitolo' style='width:500px !important'/></p>"; echo "<p class='max'>Posizione attuale in Primo Piano: <select name='PosizioneNews'>"; echo " <option value='$PosizioneNews'>$PosizioneNews</option>"; echo "</select>"; $arr = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); reset ($arr); echo "Nuova posizione: <select name='NuovaPosizioneNews'>"; foreach ($arr as $value) { echo " <option value='$value'>$value</option>"; } echo "</select> </p>"; } } vFreeResult($rsIdNews); ?> </form> "; <input type="button" name="cmdConferma" value=" Conferma" style="width:80px" onClick="subControlla()"> </form>
Il problema è che non so come si fà un update multiplo.
Grazie mille e buona giornata....

Rispondi quotando
