<?php require_once('../Connections/paivaconex.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_paivaconex, $paivaconex);
$query_Recordset1 = "SELECT * FROM mfin_clientes ORDER BY NomeFantasia ASC";
$Recordset1 = mysql_query($query_Recordset1, $paivaconex) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);



do{
	
	echo "<option value=".$row_Recordset1['Id']." >".htmlentities($row_Recordset1['NomeFantasia'], ENT_COMPAT, 'iso-8859-1')."</option>";

}while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));


mysql_free_result($Recordset1);
?>
