<?php $host = "localhost"; $user = "user"; $base = "base"; $pass = "pass"; $link = mysql_connect($host, $user, $pass) or die(); mysql_select_db($base) or die(); $query = 'SELECT * FROM `requests` LIMIT 1 ORDER by date ASC'; $result = mysql_query($query) or die(); $line = mysql_fetch_array($result, MYSQL_ASSOC); if(!empty($line) && $line != 0){ echo $line['path']; mysql_query('DELETE FROM `request` WHERE `id` = '.$line['id'].' LIMIT 1') or die(); } mysql_free_result($result); mysql_close($link); ?>