# Find minimum from a query

**URL:** <https://forum.kirupa.com/t/find-minimum-from-a-query/299134>\
**Category:** programming\
**Created:** [October 30, 2009, 11:06am UTC](https://forum.kirupa.com/t/find-minimum-from-a-query/299134 "2009-10-30T11:06:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wkt](https://avatars.discourse-cdn.com/v4/letter/w/ed655f/32.png) [@wkt](https://forum.kirupa.com/u/wkt)\
**Post date:** [October 30, 2009, 11:06am UTC](https://forum.kirupa.com/t/find-minimum-from-a-query/299134/1 "2009-10-30T11:06:10Z")

</div>

Hi there.

I am trying to find the minimum value of the results of a query but apparently, I’m still miles away from that.

I’ve tried this:

```php

$query = "SELECT MIN(general) FROM score";
$result = mysql_query($query);
echo "Minimum score is: ".$result;

```

Apparently, this doesn’t work. I’m trying to put a the results of the query into an array then use the min function of PHP to find the minimum value but I still can’t figure out how.

Can anyone help me?

Thanks in advance.
