Could someone point me to an explanation of the Warning: division by zero error please? I thought I knew what it meant, but I'm not sure now.
It simply means you are trying to divide by zero, which is mathematically impossible (how many 0's can you fit in 1, for example). Some say infinity, but its more undefined, hence the error. See this link for the specifics: http://mathforum.org/dr.math/faq/faq.divideby0.html Jay
That's what I thought it was. Would you get the same error if the variable was an empty value, instead of 0? eg '' instead of '0'
Division by zero is mathematically undefined, so if your program has such an error you will need to check the variables and put in some constraints.
Yes: <?php $four = 4; $empty = ''; echo $four / $empty; ?> PHP: [b]Warning:[/b] Division by zero in /divzero.php on line 5 Code (markup): PHP Automatically converts string to integers ('' becomes 0) when applying mathematical operations. Jay
It was an empty value causing the problem. Tracked down where it was coming from, and fixed it. Thanks.