
Jose Gomes - 2008-08-01 11:47:07
Sorry, I'm new and the greenest possible
form addnewrecord
function beforeupdate
global $conn;
$strSQLExists = "select * from price_list where codigo='".$values["Code"]."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
// if record exists send 2 values from query completing the fields and inform success
$strSQLInsert= ("insert _orders (Description, Price) VALUES ('".$data["Item"]."', '".$data["Unit_price"]."')");
db_exec($strSQLInsert,$conn);
$message="Updated ".$data["Item"].$data["Unit_price"];
foreach($values as $field=>$value)
$message.= $field." : ".$value."\r\n";
}
else
{
// if dont exist do something else
$message="There is No ";
foreach($values as $field=>$value)
$message.= $field." : ".$value."\r\n";
}
return true;
Problem, instead of
id¦code¦description¦quantity¦price
xx!0012!ipsum alori¦00000010¦£10.00
id¦code¦description¦quantity¦price
00!0000!ipsum alori¦00000000¦£10.00
xx!0012! ¦00000010¦£00.00
Stoopid hey?