Gif based counter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Allan Drake

    #1

    Gif based counter

    I am having trouble using a very simple, modifed script from this
    address:


    The script outputs an image with an incorrect file name. For example.
    "http://www.debatron.co m/numbers/.gif" Notice the file name is
    only partially there. It should be pulling out something like
    "1.gif" for a picture of the number 1 etc.

    Below is the code I am using. The segment that prints the gif sequence
    is at the end. I took alot out, but we are in a large while loop that
    is grabbing alot of stuff from mysql. You might have to ignore some of
    the code, but I put some in, just in case thats whats screwing it up.


    //Grabs $noyes string from mysql data base? (there is more mysql/php
    code above this that my progammer was doing in a while loop. Only
    $noyes variable is important)

    $sqlyes = "Select * from db_debaterespon se where db_debate_iddeb ate =
    ". MYSQL_RESULT($r esult,$i,"iddeb ate") . " and responsetype=0" ;

    $resyes = MYSQL_QUERY($sq lyes);
    $noyes = MYSQL_NUMROWS($ resyes);

    $sqlno = "Select * from db_debaterespon se where db_debate_iddeb ate =
    ". MYSQL_RESULT($r esult,$i,"iddeb ate") . " and responsetype=1" ;

    $resno= MYSQL_QUERY($sq lno);
    $noNo = MYSQL_NUMROWS($ resno);


    //configuring variables for the gif counter

    $numurl = 'http://www.debatron.co m/numbers/';
    $fileending = '.gif';


    //Prints the number from $noyes back out as gif image sequence

    for ($l = 0; $l < strlen($noyes); $l++) {
    echo "<img src=\"$numurl$n oyes[$l]$fileending\">" ;
    }

  • Geoff Berrow

    #2
    Re: Gif based counter

    Message-ID: <1185341750.123 569.30840@19g20 00hsx.googlegro ups.comfrom
    Allan Drake contained the following:
    >echo "<img src=\"$numurl$n oyes[$l]$fileending\">" ;
    $noyes probably contains a number, not a string.

    Try adding

    settype($noyes, "string");


    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Allan Drake

      #3
      Re: Gif based counter

      $noyes probably contains a number, not a string.
      >
      Try adding
      >
      settype($noyes, "string");

      Thanks you were right. I found strval($noyes) to work great for my
      puproses :) Its always the little things that catch me up.

      Comment

      • Webrickco

        #4
        Re: Gif based counter

        On Jul 25, 2:34 pm, Allan Drake <superc...@char termi.netwrote:
        $noyes probably contains a number, not a string.
        >
        Try adding
        >
        settype($noyes, "string");
        >
        Thanks you were right. I found strval($noyes) to work great for my
        puproses :) Its always the little things that catch me up.
        Take a look to http://www.webrickco.com. i have a file based counter
        with images there. You can access the code and see.

        Comment

        Working...