rdrews Posted May 5, 2009 Share Posted May 5, 2009 Not sure if this should go in the mysql section or the php section so I'm putting it in both. Sorry if that's not what I should do... Okay, here's the code that I have... <?php function reportQuery($reportName, $accountNumber){ $rq = "SELECT * FROM $reportName WHERE AccountNum = $accountNumber"; $retq = mysql_query($rq); echo mysql_error(); return $retq; } $query = "select * from accountinfo WHERE Paid = ''"; $rt = mysql_query($query); echo mysql_error(); while($kt = mysql_fetch_array($rt)){ echo "$kt[AccountNum] <br />"; echo "<table border='1' cellspacing='1' cellpadding='1'><tr><th>Type</th><th>Account Number</th><th>Employee</th><th>Pay</th></tr>"; while($rd = mysql_fetch_array(reportQuery('adjustmentsreport', $kt[AccountNum]))){ echo "<tr><td>Adjustment</td><td>$rd[AccountNum]</td><td>$rd[Name]</td><td>yes/no</td></tr>"; } echo "</table>"; } [code] My accountinfo table has various records with a field called AccountNum that are all unique (no duplicates). My adjustmentsreport table also has various records with a field called AccountNum that match numbers in the accountinfo table but are all again unique within the adjustmentsreport table. My problem is when I open this page and the code executes I get an infinite loop on the first matching AccountNum it finds. I have looked over the code way too many times and I can't figure out what is going on. Any help would be greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/156977-infinite-loop-problem-with-php-and-mysql/ Share on other sites More sharing options...
Ken2k7 Posted May 5, 2009 Share Posted May 5, 2009 Dupe of http://www.phpfreaks.com/forums/index.php/topic,251027.msg1177540.html#new The other one should be closed because this topic belongs here, but since I already replied there with help, maybe this one should be closed? Link to comment https://forums.phpfreaks.com/topic/156977-infinite-loop-problem-with-php-and-mysql/#findComment-826906 Share on other sites More sharing options...
rdrews Posted May 5, 2009 Author Share Posted May 5, 2009 I appreciate your quick response but unfortunately, that did not help. Still having the same problem. Link to comment https://forums.phpfreaks.com/topic/156977-infinite-loop-problem-with-php-and-mysql/#findComment-826948 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.