'Php cannot redeclare a function twice

Why is php not able to declare a function more than one time? I am using while loop with mySQL that contains list of IDs and I am trying to parse the ID to this function. But I get Fatal error: Cannot redeclare GetValue() (previously declared.... How do I fix this?

<?php
session_start();
ob_start();


$id = "";
$db = new PDO("mysql:host=localhost; dbname="DB";charset=utf8",'uid','');

$sqlID = "SELECT ID FROM Zip";
$stmtID = $db->query($sqlID);

$pdfArray = array();

while($dataID = $stmtID->fetch(PDO::FETCH_OBJ)){

    $id = $dataID->ID;

    $sql = "SELECT * FROM Datas WHERE ID = '$id'";
    $stmt = $db->query($sql);
    GetValue($id);
}

function GetValue($x){

//
}

?>
php


Solution 1:[1]

instead of:

GetValue($x){

//
}

try:

function GetValue($x){

//
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Moebius