How to show results with different id of the same query?

0

I have the following code which I want to show all the people of the same day, I have managed to show it but it shows me only the same id. What can I be doing wrong?

 $mm=date('M');
    $dd=date('d');
    $strConsulta = "SELECT id FROM user WHERE mes='$mm' AND dia='$dd' ";//error_reporting(0);
    $result = $conexion->query($strConsulta);
    while( $row = $result->fetch_array() )
    {
 //aqui valores

}
    
asked by Alexander Quiroz 29.08.2016 в 19:56
source

1 answer

0

Try this way:

$strConsulta = "SELECT id FROM user WHERE mes='".$mm."' AND dia='".$dd."' ";

If you want to show all you have a foreach like this:

foreach ($strConsulta as $row) {
  echo $row->id;
}
    
answered by 29.08.2016 / 20:00
source