Hi
I've written this bit of code that takes a list of order numbers from a form field and updates all the orders with those numbers in the table
$tmp = explode("\n",$_POST['COMM_NUMBERS']);
$comms = array();
foreach($tmp as $v){
$er = '';
if($v!=""){
$sql = "UPDATE comm_en SET PAYE='1',comm_temp='' WHERE ID_Commande_Site='".$v."' AND PAYE='0' LIMIT 1";
if($result = mysql_query($sql)){
$er = "Succès";
}else{
$er = mysql_error();
}
op($sql);
$comms[] = array("num"=>$v,"err"=>$er);
}
}
what i'd like it to do is if it doesn't find an order with the order number in question it would return an error
but i've tried it with non-existant order numbers and it always returns "Success"
does anyone know where i'm going wrong ?
thanks