Jump to content

[Solved] PHP Warning


Morgan

Recommended Posts

PHP Warning: Division by zero in /home/sasvirtualgroup/public_html/crew.sasvirtualgroup.com/lib/skins/skinname/frontpage_main.tpl on line 146

hello all i keep getting this error please help

note = then code on line 146 is

$percent = round(((100 * $hours_in_rank)/$difference));

Edited by Morgan
Link to comment
Share on other sites

  • Moderators

It means that $difference variable is 0. And based on maths, you can't divide something by 0. You can add an if statement before line 146 which is the following:

if($difference == 0) $difference = 1;

But I do not know if it is going to affect the results you wish to show.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...