Hi Guys i want to check and uncheck the check box of my form using PHP script. in database i am using datatype TinyInt for storing either 0 or 1. I am using following code.
<tr>
<td><div id="formEditProfileLblAEmail">Allow Email</div>
</td><td><input type="checkbox" checked="<?php
$sql = "Select firstname,middlename,lastname,nickname,require_email,allow_scores from user_info where username = '".$_SESSION['username']."'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
$row = mysql_fetch_array($result);
if($count>0)
{
if($row['require_email']=='1')
{
echo 'checked';
}
else
{
echo 'unchecked';
}
}
else
echo 'unchecked';
?>" name="formEditProfileChkAEmail" id="formEditProfileChkAEmail" /> </td></tr>
Ancak My Kontrol kutusu her zaman i veritabanında 0 veya 1 yaşıyorum olmadığı kontrol geliniyor.