bsamson Posted January 19, 2008 Share Posted January 19, 2008 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 More sharing options...
Barand Posted January 19, 2008 Share Posted January 19, 2008 If there is no error then it isn't finding any matching rows. Finding no data does not constitute an error. Link to comment https://forums.phpfreaks.com/topic/86831-looparray-question/#findComment-443788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.