I have a table called debtors with 2 fields, name and amount, where name is a% co_of% of 20 and I value a% co_of% of 13, the key field is name and is% co_of%, I can not run a simple query as:
echo implode("",mysql_fetch_row(mysql_query("SELECT * FROM deudores WHERE nombre=a")));
I already checked the names and nothing, the table does not work, but I execute a line where I do not put a condition and if it works:
echo implode("",mysql_fetch_row(mysql_query("SELECT * FROM deudores")));
the section of code that I can not execute is this:
<?php
$datos=explode("/",$_POST['abon']);
$montabon=$_POST['monto'];
if($montabon>=$datos[2]||$montabon=="todo")$montabon=$datos[2];
//Aqui
mysql_query("UPDATE deudores SET monto=monto-".$montabon." WHERE nombre=".$datos[1]);
//Aqui
echo implode("",mysql_fetch_row(mysql_query("SELECT nombre FROM deudores ")));
if($_POST['monto']=="todo"||$_POST['monto']>=$datos[2])
{
mysql_query("UPDATE regdeudas SET pagado=1 WHERE ID=".$datos[0],$conn);
echo "<h1 align=\"center\">Deuda pagada completamente</h1>";
}
else
{
mysql_query("UPDATE regdeudas SET monto=monto-'$_POST[monto]' WHERE ID=".$datos[0],$conn);
echo "<h1 align=\"center\">Monto abonado a la deuda</h1>";
}
?>