Jump to content
php.lv forumi

update


art.y

Recommended Posts

Varbūt kāds var pateikt kapēc nenotiek update's ?

if (isset($_POST['edit'])){
if (isset($_POST['checkbox']))
{
	$checkbox = $_POST['checkbox'];
	foreach ($checkbox as $checkbox)
	{
		$sql = "UPDATE `race` SET  
		`nosaukums`='" . $_POST['edit_nosaukums'.$checkbox] . "',
		...
		WHERE  (`race`.raceId = '$checkbox')";
		mysql_query( $sql )or die ("error");
	}
}

$a=mysql_query
(SELECT ...)
while ($b=mysql_fetch_array($a))
 {
echo '<form method="post">';
 echo '<input type="checkbox" name="checkbox[]" value="'.$b['raceId'].'"/>';
 echo '<textarea name="edit_nosaukums">' .$b['nosaukums']. '</textarea>';
 ...
 echo '<input name="edit" type="submit" value="Labot" />';

Link to comment
Share on other sites

×
×
  • Create New...