In a couple scripts which I've created I get the same error when I connect on my wampserver.
Every thing is running smooth but I don't like those errors.
Notice: Undefined variable
the $watdan
function is giving me this error.
For example I've to amounts that need to be count up: 2835 + 11024
I've already multipled those.
Now when I use this code:
$total[0] = $totaal->amount;
$total[1] = $totaal->price;
$watdan += $total[0] * $total[1];
Im getting the right answer 13859
but I'm also getting the error which I've mentioned.
Now when I add $watdan=0;
I only get the 11024
without the given error.
this is the full code:
$pak14 = $db->query("SELECT * FROM log_drops INNER JOIN log_items ON log_drops.item = log_items.name AND log_drops.game = log_items.game WHERE log_drops.log_id = '".$id."' ORDER BY log_drops.log_name ASC") or die($db->error);
while($totaal = $pak14->fetch_object())
{
$total[0] = $totaal->amount;
$total[1] = $totaal->price;
$watdan += $total[0] * $total[1];
}
if(isset($watdan))
{
echo $watdan; echo ' Gold';
}