<?
include ("config.php");
$npag = ("nd");
mysql_connect("$hhost","$login","$pass") or die ("Problem connecting to DataBase");
$query = "SELECT * FROM sd_ordini WHERE Ragione_Sociale = '$Ragione_Sociale' and Tipo_Pagamento='$npag' ";
$result = mysql_db_query("$dbname", $query); 
if ($result) {

while ($r = mysql_fetch_array($result)) {
$ID_Ordine = $r["ID_Ordine"];

echo "-$ID_Ordine-";
}
}
?>
