SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2001
    Location
    Georgia
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Error Message/ Divison By Zero

    Hi,

    I have a PHP script that connects to a database, and reads the number of entries for each person on a list. The script then divides the number of entries for the person by the total amount of time each entry was open before being responded to. Works great.

    However,

    When the person has no entries, PHP reports the following...

    Warning: Division by zero in /home/www/mfacs/php/thepagename.php on line 55

    Is there any way I can suppress this internal PHP error message?

    Thanks,
    Bill
    signature

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2001
    Location
    The Netherlands
    Posts
    2,617
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try to make your own error message and then make it blank.

  3. #3
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Could you not throw in an if else statement to handle it?
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do this:

    @$foo = $vara / $varb;

    -Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •