How to enter data from mySQL into inpute

You need to insert a value into name

while ($row = mysql_fetch_array($result))
    {
echo '<input  type="checkbox" name=.$row[5]. value="a1" checked>';
}

Answer 1, authority 100%

while ($row = mysql_fetch_array($result))
{
echo '<input  type="checkbox" name='.$row[5].' value="a1" checked>';
}

One more tip:
mysql_fetch_array– gives the right to use the column name in $row[] . In other words, it unites
mysql_fetch_assoc()and mysql_fetch_row()

$row["  "] = $row[ ]

Answer 2

while ($row = mysql_fetch_array($result))
    {
echo '<input  type="checkbox" name='.$row[5].' value="a1" checked>';
}