Jump to content

Loop/Array Question ...


bsamson

Recommended Posts

Alright, I have this code:

 

 

<?php
							  if ($info[depositmade] == "y") { 
							  $depositmade = "Yes";

							   $deptotsquery = mysql_query("SELECT * FROM deposits WHERE ranstr='$info[ranstr]'") or die(mysql_error());
							   $row = mysql_fetch_assoc($deptotsquery);
							   $deptotal = $row[deptotal];
							   echo $row[entries];
								   for ($ct=1;$ct<$row[entries]+1;$ct++) {
								   // Grab Dates
								   $depdatemain = "depdate".$ct;
								   $depdate[$ct] = $row['$depdatemain'];
								   // Grab Amounts
								   $depamtmain = "depamt".$ct;
								   $depamt[$ct] = "$ ".$row['$depamtmain'];
								   }
							  } else { 
							  $depositmade = "No";
							  $deptotal = ""; 
							  } 
?>

 

Let's assume that $info[depositmade] does equal "y". No apparent errors, however when I do "echo $row[depdate1];" There is no data. Can someone please explain to me why the loop isn't working? I am hoping it's some small! Thanks!

Link to comment
https://forums.phpfreaks.com/topic/86831-looparray-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.