Ho un problema con <option value….. che non restituisce l'intero valore contenuto nel database di MySQl
Queste le procedure :
<? php
<form method=post action=nomefile.php>
<select name=\"Tipo\" size=\"1\">
$nome_file_inc = "include/accessodatabase.php";
if (file_exists("../".$nome_file_inc)) {
include_once ("../".$nome_file_inc);
}
else {
if (file_exists($nome_file_inc)) {
include_once ($nome_file_inc);
}
}
$sql = 'SELECT dby.NOMESEZ, dby.NAZ1 FROM dby WHERE dby.naz1="I " GROUP BY NOMESEZ ORDER BY NOMESEZ ASC';
$result = mysql_query($sql, $global_db);
$nresult=0;
while ($ris = mysql_fetch_array($result)) {
$res[$nresult]["NOMESEZ"] = $ris["NOMESEZ"];
$res[$nresult]["NAZ1"] = $ris["NAZ1"];
If ($res[$nresult]["NOMESEZ"]) {
$nresult++;
}
}
For ($i=0; $i<$nresult; $i++) {
<option value=".$res[$i]["NOMESEZ"].">".$res[$i]["NOMESEZ"]."</option>
}
</select>
</td>
</tr>
<tr><td width=\"100%\" height=\"1\" align=\"center\" bgcolor=\"#D4D4D4\">
<input type=\"submit\" name=\"submit\" value=\"Avvio ricerca\">
</td></tr>
</form>
?>
nomefile.php
<? php
$nomesezione = $_POST['Tipo'];
$num = $_GET['id'];
$nome_file_inc = "include/accessodatabase.php";
if (file_exists("../".$nome_file_inc)) {
include_once ("../".$nome_file_inc);
}
else {
if (file_exists($nome_file_inc)) {
include_once ($nome_file_inc);
}
}
$sql = 'SELECT dby.ANNO, dby.NOMESEZ,dby.NAZ1,dbx.NUM FROM dby INNER JOIN dbx ON dby.NUM = dbx1.NUM GROUP BY dby.ANNO, dby.NOMESEZ, dby.NAZ1, dbx.NUM HAVING (((dby.NAZ1)="I ") AND ((dby.NOMESEZ)="'.$nomesezione.'"))';
$result = mysql_query($sql, $global_db);
$nresult=0;
while ($ris = mysql_fetch_array($result)) {
$res[$nresult]["ANNO"] = $ris["ANNO"];
$res[$nresult]["NOMESEZ"] = $ris["NOMESEZ"];
$res[$nresult]["NAZ1"] = $ris["NAZ1"];
$res[$nresult]["NUM"] = trim ($ris["NUM"]);
if ($res[$nresult]["ANNO"]) {
$nresult++;
}
}
?>
NON VIENE RESTITUITO IL VALORE COMPLETO DI “NOMESEZ”
Esempi :
“MILANO PARCO LAMBRO” VIENE TROVATO SOLO COME “MILANO”
“REG. LOMBARDIA EST” VIENE TROVATO SOLO COME “REG.”
“REG. LOMBARDIA OVEST” VIENE TROVATO SOLO COME “REG.”
QUALE L’ISTRUZIONE CHE FA VEDERE IL CONTENUTO COMPLETO DI “NOMESEZ” IN :
<option value=".$res[$i]["NOMESEZ"].">".$res[$i]["NOMESEZ"]."</option>
E POI IN
$nomesezione = $_POST['Tipo'];