- Home
- Categorie
- Coding e Sistemistica
- Coding
- problema per associare valore tabella a link
-
problema per associare valore tabella a link
ciao ragazzi ho un grosso problema.
io ho una tabella nella quale vengono stampati dei nomi, accanto ad ogni nome ho messo un link che cliccandoci sopra sia riferito prpio al nome accanto e cosi via. non riesco a capire che sbaglio vi posto il codice:<?php if(IsSet($_SESSION['utente'])){ $user=$_SESSION['utente'][0]; //echo $user; $query1 = "SELECT * FROM utente WHERE username = '$user'"; $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error()); $row = mysql_fetch_assoc($result1); $idutente = $row['idutente']; // echo $idutente; $query ="Select * from definisce WHERE idutente = '$idutente'"; $ris=mysql_query($query) or die("Errore nella query:".mysql_error()); $numrows = mysql_num_rows($ris); for($x=0; $x<$numrows; $x++){ $resrow = mysql_fetch_row($ris); $idlista=$resrow['1']; //echo $idlista; $query4 = "SELECT * FROM liste where idlista = '$idlista'"; $result1 = mysql_query($query4) or die("Errore nella query4:".mysql_error()); $row = mysql_fetch_assoc($result1); $nome = $row['nome']; ?> <table width="293" border="2"> <tr> <td width="86" height="42"><?php echo $nome; ?> <?php echo "<br>"; ?></td> <td width="149"><a href="formmodificanomegruppo.php">modifica nome gruppo</a></td> <td width="34"> </td> </tr> </table> <?php } ?> <?php }else { echo "errore"; } ?> </body> </html>
<?php
//Includo i file per la connessione
//e per la verifica Utenteif(IsSet($_SESSION['utente'])){
echo "<p>Benvenuto tutorutente: ".@$_SESSION['tutor'][0];}else
{
echo "errore";}
$user=$_SESSION['utente'][0];
//echo $user;$query1 = "SELECT * FROM utente WHERE username = '$user'"; $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error()); $row = mysql_fetch_assoc($result1); $idutente = $row['idutente']; echo $idutente;
$query ="Select * from liste where idlista";
$ris=mysql_query($query) or die("Errore nella query2:".mysql_error());
$numrows = mysql_num_rows($ris);
for($x=0; $x<$numrows; $x++){
//Recupero il contenuto di ogni record rovato
$resrow = mysql_fetch_row($ris);$nome=$resrow[1];
echo $nome;}
?>
<strong>MODFICA IL NOME DEL GRUPPO</strong><form action="modificanomegruppo.php" method="post" name="formgruppo">
<p>nome gruppo
<input name="<?php echo $nome;?>" value="<?php echo $nome;?>" type="text" />
</p>
<p>
<input name="salva" type="submit" value="salva modifiche"/>
</p>
</form></body>
</html>[code]
/code]