josh-j-c Posted March 24, 2008 Posted March 24, 2008 <?php $macropage="criminal.php"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $q2=$db->query("SELECT * FROM crimes ORDER BY crimeBRAVE ASC"); while ($r2=$db->fetch_row($q2)) { $crimes[]=$r2; } $q=$db->query("SELECT * FROM crimegroups ORDER by cgORDER ASC"); print "[b]Criminal Centre[/b] <table width='75%' cellspacing=1 class='table'><tr><th>Crime</th><th>Cost</th><th>Do</th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td colspan='3' class='h'>{$r['cgNAME']}</td></tr>"; foreach($crimes as $v) { if($v['crimeGROUP'] == $r['cgID']) { print "<tr><td>{$v['crimeNAME']}</td><td>{$v['crimeBRAVE']} Nerve</td><td>[url='docrime.php?c={$v[']Do[/url]</td></tr>"; } } } print "</table>"; $h->endpage(); ?> im getting the error message, Warning: Invalid argument supplied for foreach() in /home/hosting4/public_html/crimecounty/criminal.php on line 16 What do i do ? any idea's thanks :-D Quote
Tonka Posted March 25, 2008 Posted March 25, 2008 Re: Problem with criminal.php V2 the code looks fine to me Quote
Analog Posted March 25, 2008 Posted March 25, 2008 Re: Problem with criminal.php V2 is the db table empty? Quote
Tonka Posted March 26, 2008 Posted March 26, 2008 Re: Problem with criminal.php V2 have you created any crime groups yet? if not create some and put some crimes into them, and that should fix your problem Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.