when i checked and not checked the employed checkbox it gives only 0 in the database. how do i fix it?
this is my php code block.
$conn = mysqli_connect('localhost','','','login');
$name=$_POST['name'];
$pword=$_POST['pword'];
$type=$_POST['type'];
$chk=$_POST['chk'];
$sql="insert into login(name,password,type,employed)values('$name','$pword','$type','$chk')";
mysqli_query($conn,$sql);
mysqli_close($conn);
echo "successfully inserted.<br/>";
print "<a href='student.php'>Back</a>";
Aucun commentaire:
Enregistrer un commentaire