Hi guys!
Im trying to get the ighest value from any array coming from mysql query.
What i've till now is it!
class vfsClass{
function localvfs() {
try {
$sql = $this->link->prepare("select Vfs_ID from tbl_track order by id asc");
$sql->execute();
$rs = $sql->fetchAll(PDO::FETCH_ASSOC);
return $rs;
} catch (PDOException $e) {
echo $e->getMessage();
}
}
}
$q = new vfsClass();
$qr = $q->localvfs();
foreach ($qr as $key => $value)
{
echo $key. '<br>';
foreach ($value as $key1 => $value1)
{
echo "$key1: $value1 <br>";
}
}
What i get from this loop or output for this query is
0
Vfs_ID: PRP1438299
1
Vfs_ID: TRC1107224
2
Vfs_ID: TRC1107224
3
Vfs_ID: TRT1458445
4
Vfs_ID: TRR148864
5
Vfs_ID: TRR1463373
6
Vfs_ID: TRR1045837
7
With this loop, i can get each value inside of array, but im trying to get the ighest value of $key,like i want to echo only 7.
So how do i do that.
I tried use the function get_highest() but dint work well maybe i used in wrong way!
Can someone help me with this.
Waiting ear from you guys.
Regards