I need my input box to be able to read the current value from the database, but also be able to change that value.
When I input something into this inputbox such as 1000, it gets posted fine. My post results from PHP look like:
Data updated col1 Supplies col2 col3 1000 col4 servicereq 2 owneremail test2 piemail test2 id1 466
So the value for col3 = 1000, but it does not get entered into the mysql database. But for the dropdown menus (serreqid, owneremail, piemail) update in mysql fine.
How the input box is generated:
<form action='insert.php' method='post'>
<input type='text' name=col3 id=col3 value='$col3' size='11' onblur='this.form.submit()'>
Mysql update:
$col1=$_POST['$col1'];
$col2=$_POST['$col2'];
$col3=$_POST['$col3'];
$col4=$_POST['$col4'];
$serreqid = $_POST['servicereq'];
$owneremail = $_POST['owneremail'];
$piemail = $_POST['piemail'];
$id1 = $_POST['id1'];
$sql = "UPDATE reportlog SET service_quantity = ('$col3'),
service_request_id = ('$serreqid'), owner_email = ('$owneremail'),
pi_email = ('$piemail') WHERE id = ('$id1')";
if(!mysqli_query($con, $sql))
{
echo "not updated ";
}else{
echo "Data updated ";
}