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){
//
}
?>