I have a script that reads all rows from a database, and prints it out to an html table. The html table has an extra column for "status".In this column there is a form that is supposed to submit the dropdown field to the mysql database. I've got the set up so it updates the database IF I give the processing script a static id number.
My question is...
How do I make the update_db.php script work If i need a variable for row number?
<?php
$hostname="hostname";
$username="username";
$password="password";
$db="database";
$entry= $_POST['status'];
// Connect to Mysql
$global_dbh = mysql_connect($hostname, $username, $password)
or die("Could not connect to database");
//Select mysql database
mysql_select_db($db, $global_dbh)
or die("Could not select database");
mysql_query("UPDATE cold_call_data SET status = $entry
WHERE id = $id ")
or die("Could not update database!");
echo "\ndatabase updated successfully!";
?>