php - Im trying to get the value of id in my sql database and insert it as the value of my checkbox -
im trying value of id in sql database , insert value of checkbox.
while( $result = mysql_fetch_object( $requete ) ) { $temp = $temp + 1; echo(" <form><div align =\"center\">".$result->nom." ".$result->prenom."<input type='checkbox' name='sel[]' value='$temp'>"); } echo("<br><br><input type='button' onclick='confirme($temp)' value='supprimer'></form>");
$temp should value of id in sql, , function confirme() should run value of id.
<?php while( $result = mysql_fetch_assoc($requete)) { $temp++; echo "<form><div align ='center'> $result[nom] $result[prenom] <input type='checkbox' name='sel[]' value='$temp'>"; } echo "<br><br><input type='button' onclick='confirme($temp)' value='supprimer'></form>"; ?>
try this
php sql
No comments:
Post a Comment