[PHP] Re: Division by zero

2002-10-07 Thread Gary
I found a problem in the rows but that didn't fix it. if I test for votes, total, and percentages it work perfect. To do this I have to cut part of the code and rearrange the braces. I beginning to think it is a problem with braces being wrong or id test code query($sql); if (DB::isError(

[PHP] Re: Division by zero

2002-10-07 Thread Owen Prime
Make sure that vote1, vote2, and vote3 are not null. Maybe you need to use the IFNULL(vote1, 0) function. Cheers, Owen. Gary wrote: > I am trying t get the percent of votes form the table poll, but keep > getting Division by zero for the line commented below. > > > if ($res) { > echo "b