# PHP - print only ONE id

**URL:** <https://forum.kirupa.com/t/php-print-only-one-id/107544>\
**Category:** Uncategorized\
**Created:** [April 16, 2004, 1:53pm UTC](https://forum.kirupa.com/t/php-print-only-one-id/107544 "2004-04-16T13:53:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)\
**Post date:** [April 16, 2004, 1:53pm UTC](https://forum.kirupa.com/t/php-print-only-one-id/107544/1 "2004-04-16T13:53:38Z")

</div>

I have this PHP script:

$sql = “SELECT id FROM superintendent WHERE active = ‘no’”;  
$result = mysql\_query($sql) or die(“Couldn’t get file list”);  
while($row = mysql\_fetch\_row($result))  
{  
echo ($row[0]);  
}

Of course, the echo displays all id that are set to active = ‘no’. But how can I get only ONE result.

Something like echo(i dont know what) and will only display ONE id; not all of them.

Thanks in advance,

Leo :hair:
