Warning: Division by zero Error

Discussion in 'PHP' started by versus2, Jul 15, 2007.

  1. #1
    Hi,

    I'm not a programmer and i've just moved to a new server and i get the following error on my site (custom script. lost contact with the programmer):

    Warning: Division by zero in /home/**/public_html/templates_c/%%AA^AA0^AA0EB992%%details.tpl.php on line 71 
    Code (markup):
    It was working fine on the old host so i thought maybe it's a server settings / mysql settings / php settings error.. is it ?

    I googled about it and it seems like it may have caused by division of integer in zero. I have no idea how to change the code to make it work tho.

    Any help would be realy appreciated.

    Thanks,
    E-A.
     
    versus2, Jul 15, 2007 IP
  2. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    can you post that line of code here?
     
    gibex, Jul 15, 2007 IP
  3. versus2

    versus2 Well-Known Member

    Messages:
    796
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Ahh.. Oops. That's the line that is causing the error:

    <?php if ($this->_sections['i']['index'] % $this->_tpl_vars['row'] == 0 && $this->_sections['i']['index'] != 0): ?>
    
    Code (markup):
     
    versus2, Jul 15, 2007 IP
  4. versus2

    versus2 Well-Known Member

    Messages:
    796
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Got this resolved. Thanks everybody.
     
    versus2, Jul 15, 2007 IP
  5. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #5
    glad to hear you solved the issue :)
     
    gibex, Jul 15, 2007 IP