Help in displaying all the record instead of 1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rocky86
    New Member
    • Jun 2007
    • 93

    #16
    Originally posted by volectricity
    You need to start doing some debugging. Make your ActionScript display everything from the PHP file, and start making the PHP file echo out everything that you can. There is no magic solution... You HAVE to put forth some effort.
    Hey volectricity I did alot of testing and I realize that it keep returning me the same value for both the uname and uid:

    uid=Khali Signh&uname=Kha li Signh&

    this is what I get what is wrong with it I don't know why the uid is displaying the same value as the uname when it should be displaying uid

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #17
      Heya, Rocky.

      Quick, what's the difference between if and while?

      The answer to that question is the reason why you're only getting one record.

      If you don't know the answer to that question, you might want to consider picking up a PHP programming book, or else have a look at PHP Control Structures.

      Comment

      • Rocky86
        New Member
        • Jun 2007
        • 93

        #18
        Originally posted by pbmods
        Heya, Rocky.

        Quick, what's the difference between if and while?

        The answer to that question is the reason why you're only getting one record.

        If you don't know the answer to that question, you might want to consider picking up a PHP programming book, or else have a look at PHP Control Structures.
        Hey pbmods I noe the different between the if and while if just loop through 1 record while loop through all the record until that is no matching result but I try both using if and while it still return me the same thing

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #19
          Heya, Rocky.

          Never mind me. Upon closer inspection, your problem is actually here.

          [code=php]
          foreach($row as $col_value)
          {
          $temp[$counterx] = $col_value;
          $counterx++;
          }
          [/code]

          You'll want to change that entire block to simply:
          [code=php]
          $temp[] = $row;
          [/code]

          Then to create $report:
          [code=php]
          $report = '';
          foreach($temp as $row => $data)
          {
          $report .= ($report ? '?' : '&') . "uid={$data[0]}&uname={$dat a[1]}";
          }
          [/code]

          Comment

          • Rocky86
            New Member
            • Jun 2007
            • 93

            #20
            Originally posted by pbmods
            Heya, Rocky.

            Never mind me. Upon closer inspection, your problem is actually here.

            [code=php]
            foreach($row as $col_value)
            {
            $temp[$counterx] = $col_value;
            $counterx++;
            }
            [/code]

            You'll want to change that entire block to simply:
            [code=php]
            $temp[] = $row;
            [/code]

            Then to create $report:
            [code=php]
            $report = '';
            foreach($temp as $row => $data)
            {
            $report .= ($report ? '?' : '&') . "uid={$data[0]}&uname={$dat a[1]}";
            }
            [/code]

            Hey pbmods I manage to get the both the uid and uname to be display actionscripts by this php code I did:

            [PHP]
            $report = "&";

            $counterx=0;
            while($row=mysq l_fetch_assoc($ resultpostal)){
            foreach($row as $col_value){
            $temp[$counterx]=$col_value;
            $counterx++;
            }


            $report.="uid". "=".$temp[1]."&";
            $report.="uname "."=".$temp[0]."&";



            echo $report;

            [/PHP]

            Thx I finally manage to do it with a different method after trying and trying

            Comment

            Working...