Jump to content

$Results & $AffectedRows Problem


mickeymouse

Recommended Posts

The third section of code below gave me some results (some amounts) but these were incomplete so I coded the first (TEMP) section to list my rows for debugging purposes.  When I did that, the results in my third section all changed to 0 amounts. So, for further debugging purposes, I coded section 2.  Section 1 listed my rows but section 2 did not list any rows - only the "LIST2" & "END2".
I don't understand why, I get 0 amounts nor why section 2 wont list. (I don't think I have coding errors).

			//TEMP  SECTION 1 --------------------------
		    print("List1<br>");
		    $rowcnt=$AffectedRows;
		    $myResults=$Results;
		        while ($rowa = mysql_fetch_row($myResults))
			    {print("$rowa[0] / $rowa[1] / $rowa[2] / $rowa[3] / $rowa[4] / $rowa[5] / $rowa[6] / $rowa[7] / $rowa[8]<br>");}
			    print("END1<BR>");
			//TEMP===========================
			
		    //TEMP SECTION 2 --------------------------
		    print("LIST2<br>");
		    $rowcntx=$AffectedRows;
		    $myResults=$Results;
		        while ($rowx = mysql_fetch_row($myResults))
			    {print("$rowx[0] / $rowx[1] / $rowx[2] / $rowx[3] / $rowx[4] / $rowx[5] / $rowx[6] / $rowx[7] / $rowx[8]<br>");}
			    print("END2<BR>");
			//TEMP===========================
		   
            SECTION 3----------      
		    for ($loop=1;$loop<($AffectedRows+1);$loop++)
			{while ($row = mysql_fetch_row($Results))
			    {if($row[8]=="b")
					{$BBal[$row[4]] = ($BBal[$row[4]] - $row[3]);
					$BBal[$row[5]] = ($BBal[$row[5]] + $row[3]);}
				else{$Bal[$row[4]] = ($Bal[$row[4]] - $row[3]);
					$Bal[$row[5]] = ($Bal[$row[5]] + $row[3]);}}}
             ...print results...

 

Link to comment
Share on other sites

Hi there,

So first off, your results! You say they're incomplete and don't understand why, that's cool. But what are the results you wanted? What did you end up getting? What data is in your database? If you can mock up a database entry, and give us your expected output, and actual output, we might be able to get somewhere.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...