@RemiX; buyrun hocam
<?php
/*
SELECT `tarih` FROM `veriler` ORDER BY `tarih` ASC LIMIT 0, 1; -- İlk girilen veri
SELECT `tarih` FROM `veriler` ORDER BY `tarih` DESC LIMIT 0, 1; -- Son girilen veri
*/
$first_record_inserted_at = null;
$last_record_inserted_at = null;
$first_record_resource = mysql_query("SELECT `tarih` FROM `veriler` ORDER BY `tarih` ASC LIMIT 0, 1");
$last_record_resource = mysql_query("SELECT `tarih` FROM `veriler` ORDER BY `tarih` DESC LIMIT 0, 1");
if(mysql_error($first_record_resource) === 0)
{
while($first_record_row = mysql_fetch_assoc($first_record_resource))
{
$first_record_inserted_at = $first_record_row["tarih"];
}
}
if(mysql_error($last_record_resource) === 0)
{
while($last_record_row = mysql_fetch_assoc($last_record_resource))
{
$last_record_inserted_at = $last_record_row["tarih"];
}
}
print_r(
array(
"first_record_inserted_at" => $first_record_inserted_at,
"last_record_inserted_at" => $last_record_inserted_at
)
);