Select in MySQL dupa data de azi
Scris: Joi Aug 23, 2012
Vreau afisez niste date dintr-un tabel dupa data din ziua respectiva , in cazul in care sunt date adaugate in acea zi in tabel.
Acesta este codul pe care il folosesc.Nu imi da nici o eroare , dar nu imi afiseaza datele (de astazi in cazul de fata) .Am date adaugate astazi in tabel , dar el imi afiseaza acest echo , ca si cum nu ar fi existand date in tabel.
Daca dau select dupa Id , sau daca dau select data='22-08-2012' " el imi returneaza ce trebuie.
Multumesc .
Cod: Selectaţi tot
$data=@date('d-m-Y');
mysql_select_db("autentificare", $conexiune);
$result= mysql_query("SELECT *FROM clients WHERE data=".$data);
if(mysql_num_rows($result)>0)
{
while($row = mysql_fetch_array($result))
{
echo'
<b>Name:</b> '.$row['name'].' </br />
<b>Surname:</b> '.$row['surname'].' </br />
';
}
echo'
Press<a href="paginamenu.php"> here </a>to go back previous page
Press<a href="iesire.php"> here </a></span>to exit.
</div></center>
' ;
}
else{
echo'
<center> <div class="menuprod3" >
Hei <b><i>'.$_SESSION['user'].'</b></i></div>
Sory! Today we don`t have any customers !</div>
Press<a href="paginamenu.php"> here </a>to go back previous page.</div>
Press<a href="iesire.php"> here </a>to exit.
</div></center>
';
}
mysql_close($conexiune);
}
Cod: Selectaţi tot
else{
echo'
<center> <div class="menuprod3" >
Hei <b><i>'.$_SESSION['user'].'</b></i></div>
Sory! Today we don`t have any customers !</div>
Press<a href="paginamenu.php"> here </a>to go back previous page.</div>
Press<a href="iesire.php"> here </a>to exit.
</div></center>
';
}
Multumesc .