i am try to do check boxes....i have 300++ of name list and all of them i want to put a check box...how can i store and retrieve the data in phpmyadmin? how can i store checked name back into the table in database?

help me please

Member Avatar for diafol
while($row = mysql_fetch_array($resultset)){
  echo "<input type=\"checkbox\" name=\"item[]\"" id=\"item_{$row['id']}\" value=\"{$row['id']}\"> <label for=\"item_{$row['id']}\">$row['somefield']</label>";
}

You then retrieve $_POST as an array and get the values of the selected checkboxes which are the id values in your DB.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.