in reply to Troubleshooting help...

Do you see something WRONG with that code?

I consider that not using query parameters is wrong, but that probably has nothing to do with the problem you're seeing.

The only way you should see "1000%" is if you fetch a row whose "utype" field doesn't start with "i" or "h". How certain are you of your data? Are you sure that some fields don't start with "I" or "H". Or are some "s" records sneaking in?

A quick-and-dirty way to get some visibility onto the problem is to add

$html_content .= "<!-- " . $aff_row->{utype} . " -->";
after you fetch the row. Then, you can view the HTML source to see what you really got.

Dumping diagnostic info into HTML comments is a trick you can get a log of leverage from.

Update: You're generating bogus HTML, but that's a separate issue. Emit </td>, not </td />.

Replies are listed 'Best First'.
Re: Re: Troubleshooting help...
by powerhouse (Friar) on Feb 15, 2003 at 18:25 UTC
    Thank you. I'm very sure of the i,h, and s. I know that, because it's a enum("i","h","s") i=impression, h=hit(click), s=sale

    </td /> Is not that the way CGI.pm prints a table? I once asked why, and they said it was for DHTML, or XML or something like that. That is why I do that.

    I dunno ;o)

    Anyways, I made a mistake with what is wrong. It is adding them correctly, I forgot this was on the daily report, so the ones I added, went in with a timestamp different from the days I was looking at, so I changed days to today, and they are added up correctly, however, I get 0% from the division.

    So, I guess that is the only problem now.

    Should I get rid of the </td /> and just use the regular code?

    thx,
    Richard
      I changed days to today, and they are added up correctly, however, I get 0% from the division.

      The way your logic is set up, only one of $tracked_click or $tracked_impressions will be 1 when

      ($tracked_click*1) / ($tracked_impressions*1)
      is executed. The other will be zero. You're either going to divide zero by one, giving zero, or you're going to divide by zero. Is this really what you want to do?

      Should I get rid of the </td /> and just use the regular code?

      You should use </td>. The "trailing slash" form of tags is reserved for those tags that are not paired, like <br/>.

        Ok, I fixed it. I was using two different variables for the tracked_clicks I was not putting the ending s on it, when doing the dividing.

        Duh ;(
        I cannot believe I missed that;o)

        MANY Thanks for the help everyone!

        Thx,
        Richard