$bugun = date("Y-m-d");
$dogum_cek = mysql_query("SELECT * FROM secim_uyeleri WHERE STR_TO_DATE(uye_dogum,'%d-%m-%Y') = '".$bugun."'");
while ($a= mysql_fetch_array($dogum_cek)){
$uye_dogum = $a['uye_dogum'];
$uye_isim = $a['uye_isim'];
$uye_tel = $a['uye_tel'];
echo'
<tr>
<td>'.$uye_isim.'</td>
<td>'.$uye_tel.'</td>
<td>'.$uye_dogum.'</td>
</tr>';}
I have varChar column in mysql table where i keep birthdays.(I inserted as varChar because of excel including.) So now i have to retrieve rows with current days who has birthdays. I tried str_to_date to retrieve varChar as date but could not get any results.
"uye_dogum" is the varChar column where i keep birthdays as dd-mm-YYYY.
SELECT * FROM secim_uyeleri WHERE ( I NEED THIS PART) = '".$bugun."'
$bugun = date("d-m");
$dogum_cek = mysql_query("SELECT uye_dogum,uye_isim,uye_tel FROM secim_uyeleri WHERE LEFT(uye_dogum,5) LIKE '".$bugun."' ORDER BY uye_isim");
while ($a= mysql_fetch_array($dogum_cek)){
$uye_dogum = $a['uye_dogum'];
$uye_isim = $a['uye_isim'];
$uye_tel = $a['uye_tel'];
echo'
<tr>
<td>'.$uye_isim.'</td>
<td>'.$uye_tel.'</td>
<td>'.$uye_dogum.'</td>
</tr>';}
Solution is here.. i can get all rows like this.. For little solution i am going to use it..