Código PHP:
$sql = "select IdUsuario, Descripcion from usuarios ".$where." order by rand() limit 1";
no sé como generar el where, ya que cuando una option del select list/menu vale 0 no se debe filtar por su columna.. estoy liado con esto..
realicé un script mediocre...
Código PHP:
$where = "where ";
if ($_POST['Sexo'] != 0) {
$where .= "Sexo = '".$_POST['Sexo']."' ";
}
if ($_POST['Orientacion'] != 0) {
$where .= "Orientacion = '".$_POST['Orientacion']."' ";
}
if ($_POST['Edad'] != 0) {
$where .= "Edad = '".$_POST['Edad']."' ";
}
if ($_POST['Pais'] != 0) {
$where .= "Pais = '".$_POST['Pais']."' ";
}
if ($_POST['Provincia'] != 0) {
$where .= "Provincia = '".$_POST['Provincia']."' ";
}
me dan una ayuda?
con ifs es complicado, con switchs no se puede...
tal vez con arrays??
espero respuestas, gracias
![Adios](http://static.forosdelweb.com/fdwtheme/images/smilies/adios.gif)