Hi I keep trying these last few days to make this code work and I don’t know where to take it from here. here is what it should do :
take value from mysql table and show it in combo box - this works
and some checkboxes if selected update the column autor whit 1 else update whit 0 but the problem is thet the name where it shoud be updated is taken from the chosen combobox.any can help me
[php]
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) die('Could not connect: ' . mysql_error());
mysql_select_db("try", $con);
$sql = "SELECT * FROM incerc";
$result = mysql_query($sql,$con);
$ord=0;
while($row = mysql_fetch_array($result))
{
$ord++;
echo "".$row['nume']."\n";
}
echo "";
if (isset($_POST['autor'])) {
mysqli_query($con,"UPDATE persoane SET autor=1
WHERE nume='here shoud be value of combobox'");
// Checkbox is selected
} else {
mysqli_query($con,"UPDATE persoane SET autor=0
WHERE nume=''");
// Alternate code
}
if (isset($_POST['recenzor'])) {
// Checkbox is selected
} else {
// Alternate code
}
if (isset($_POST['editor'])) {
// Checkbox is selected
} else {
// Alternate code
}
mysql_close($con);
?>
<form action="">
Autor
Recenzor
Editor
[/php]