1398305717 <- my sql database time code like this
mysql time row name is time
.php
$numMonth = date('m', $time);
$sql = mysql_query("SELECT * FROM videos WHERE date('m',`time`) = $numMonth DESC LIMIT 1");
$row = mysql_fetch_assoc($sql);
echo $id = $row['id'];
i want to get last id equals to month numer? so i tried to like this.. but not work. how to get it from php. so help me to this post how to get month number from sql.. thanks.
Edit : i want like this.. but not work :(
$sql = mysql_query("SELECT * FROM videos WHERE MONTH(FROM_UNIXTIME(`time`)) = '$numMonth' DESC LIMIT 1");