ciao a tutti...
io ho elaborato questo script ke xò nn funge x come dovrebbe
il risultato di questo script lo si può trovare QUICodice PHP:<?php
require "db_conn.php";
$query = "SELECT * FROM sondaggio";
$result = mysql_query($query, $db_connect) or die("Errore...");
$array = mysql_fetch_array($result);
$domanda= $array[1];
$numrows = mysql_num_rows($result);
print "<table height=237 bgcolor=#993333>
<tr>
<th rowspan=\"2\" width=\"1\"></th>
<th width=\"138\" height=\"23\"><span class=\"Stile1\">Sondaggio </span></th>
<th rowspan=\"2\" width=\"1\"></th>
</tr>
<th height=\"185\"> <table bgcolor=\"#000000\" width=\"138\" height=\"198\">
<tr>
<th height=\"37\" colspan=\"2\"><span class=\"Stile1\">$domanda</span></th>
</tr>
<form action=\"scriptso.php\" method=\"post\" name=\"sondaggio\" id=\"sondaggio\">";
{
for($x=0; $x<$numrows; $x++){
$resrow = mysql_fetch_row($result);
$id = $resrow[0];
$opzione = $resrow[2];
$voti = $resrow[3];
print "<tr>
<th width=\"34\"><input name=voto type=radio id=$id value=$opzione /></th>
<th height=\"26\"><span class=Stile1>$opzione</span></th>
</tr>";
}
};
print "<tr>
<th height=\"27\"><span class=\"Stile1\"></span></th>
<th width=\"92\"><input name=\"submit\" type=\"image\" src=\"grafica/button.gif\" alt=\"vota\" /></th>
</tr>
</form>
</table>
</th>
</tr>
<tr width=\"4\">
<th height=\"4\" colspan=\"3\" ></th>
</tr>
</table>";
?>
sarebbe lo script del sondaggio solo ke nn riesco a far prelevare la prima opzione dal database infatti l'ultimo campo del sondaggio rimane vuoto e senza valore!!
Dov'è l'errore????
GRAZIE

Rispondi quotando