I have a DataTable here and I'm using a plugin so the user can edit the table data, I got it in parts (haha), the problem is that my call is not identifying what the user is entering, and when I define manually the cell value it changes on all rows of that column in db, I guess I need to identify the line ID that the user is editing but I do not know how to do it.
Below my Ajax Call:
$.ajax({
url: "include/edita.php",
type: "POST",
data: { 'coletadora': 'Definição Manual'},
success: function(data){
alert(data);
}
});
It is also relevant the content of my edita.php (ignore the php lagged, was a long time away from php and I need this system running before transitioning to PDO), I know I need a WHERE to limit the update to this determined ID we are going to find out:
<?php
$host= 'localhost';
$bd= 'minhadb';
$userbd = 'meuusr';
$senhabd= 'meupw';
//Conectando com banco MySQL
$conexao = mysql_connect($host,$userbd,$senhabd);
if (!$conexao)
die ("Erro de conexão com localhost, o seguinte erro ocorreu -> ".mysql_error());
//Conectando com a tabela do banco de dados
$banco = mysql_select_db($bd,$conexao);
if (!$banco)
die ("Erro de conexão com banco de dados, o seguinte erro ocorreu -> ".mysql_error());
$coletadora = $_POST["coletadora"];
$sql = "UPDATE minhadb SET coletadora = '$coletadora'";
mysql_query($sql,$conexao);
?>
Thank you in advance for the help!