0

Sorry my English a little, My date column is 1375801584 valuable epoch format. I wanna only select now and next time records, i want hide history times record. eg: 19:45 and later.

<?php
$sql = mysql_query("select tarih from table where tarih < '$date' order by tarih ASC");
while($r = mysql_fetch_assoc($sql)){
?>
    <tr><td><?php echo date("Y-m-d", $r['tarih']); ?></td>
    <td><?php echo date("H:i", $r['tarih']); ?></td></tr>
<?php
}
?>
1

1 Answer 1

2

You close. Your current query is selecting older records (<). Try using >=:

$sql = mysql_query("select date from table where date >= '$date;' order by date ASC");
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for help but not working this code, not list records this query.
Are you sure you have valid values in your database?
my date column name is "tarih" (turkish date) i edit my post now.
query listed to 2013-08-06 19:00 , 2013-08-06 19:30 timed records, but now time is 2013-08-07 00:40 .. I want only 00:38 and later time records, help me please.
$aqaq = time(); $sql = mysql_query("select tarih from table where tarih > '$aqaq;' order by tarih ASC"); Thanks for help. I solved my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.