Ho cambiato il codice così, ma mi scrive Array e inserisce nel db una riga sola
ed il codice per l'inserimento:codice:<form action="?do=4" method="POST" > <table width="530"> <tr> <td width="30"><input name="giorno[1]" type="hidden" value="Ven" />Ven</td> <td width="20"><input name="numero[1]" type="hidden" value="1" />1</td> <td width="60"><input name="mese[1]" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo[1]" cols="35" ></textarea></td> <td width="100"><input name="importante[1]" type="checkbox" value="si" /> Importante!</td> </tr> <tr> <td width="30"><input name="giorno[2]" type="hidden" value="Sab" />Sab</td> <td width="20"><input name="numero[2]" type="hidden" value="2" />2</td> <td width="60"><input name="mese[2]" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo[2]" cols="35" ></textarea></td> <td width="100"><input name="importante[2]" type="checkbox" value="si" /> Importante!</td> </tr> <tr> <td width="30"><input name="giorno[3]" type="hidden" value="Dom" />Dom</td> <td width="20"><input name="numero[3]" type="hidden" value="3" />3</td> <td width="60"><input name="mese[3]" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo[3]" cols="35" ></textarea></td> <td width="100"><input name="importante[3]" type="checkbox" value="si" /> Importante!</td> </tr> </table> <input name="submit" type="submit" value="Invia">
codice:$giorno = $_POST["giorno"]; $numero = $_POST["numero"]; $mese = $_POST["mese"]; $testo = $_POST["testo"]; $importante = $_POST["importante"]; $inserimento="INSERT INTO `calendario` (id,giorno,numero,mese,anno,testo,importante) VALUES ('','$giorno','$numero','$mese','$anno','$testo','$importante')"; $risultato=mysql_query($inserimento, $link); if($risultato) echo "Inserito con successo!";


Rispondi quotando