daddytednips Posted November 2, 2008 Posted November 2, 2008 I have not done anything to the file but i get the error: Warning: Invalid argument supplied for foreach() in /home/jimbobra/public_html/criminal.php on line 16 I am not sure how to fix this so i thought i'd see if you guys could help in any way, thanks in advance. Quote
AlabamaHit Posted November 2, 2008 Posted November 2, 2008 Re: criminal.php Post some code, lol. there is no way to know without seeing... NOT the whole page.. Just post about 10 codes...before and After the error line. :mrgreen: Quote
daddytednips Posted November 2, 2008 Author Posted November 2, 2008 Re: criminal.php lol, thanks, i'm only just starting php. before: } $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>"; and after: { if($v['crimeGROUP'] == $r['cgID']) { print "<tr><td>{$v['crimeNAME']}</td><td>{$v['crimeBRAVE']} Brave</td><td>[url='docrime.php?c={$v[']Do[/url]</td></tr>"; } } } print "</table>"; do you need the actual line of code that's wrong? Quote
AlabamaHit Posted November 2, 2008 Posted November 2, 2008 Re: criminal.php yeah what i ment was post lines 6 - 26 all in one, lol... Quote
daddytednips Posted November 2, 2008 Author Posted November 2, 2008 Re: criminal.php rofl, ok xD 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']} Brave</td><td>[url='docrime.php?c={$v[']Do[/url]</td></tr>"; } } } print "</table>"; $h->endpage(); ?> [me=daddytednips]crosses fingers lol[/me] Quote
AlabamaHit Posted November 2, 2008 Posted November 2, 2008 Re: criminal.php hum....just to keep you up to date. im looking but have not seen nothing yet....looks ok to me so far Quote
daddytednips Posted November 2, 2008 Author Posted November 2, 2008 Re: criminal.php ok, thanks Quote
Floydian Posted November 2, 2008 Posted November 2, 2008 Re: criminal.php Have you actually made any crimes yet? Quote
daddytednips Posted November 2, 2008 Author Posted November 2, 2008 Re: criminal.php yus, i have made one crime Quote
Mafia-Club Posted November 2, 2008 Posted November 2, 2008 Re: criminal.php Have you made a crime group if not then thats probably causing the error Quote
daddytednips Posted November 3, 2008 Author Posted November 3, 2008 Re: criminal.php Thanks for contributing guys but i solved it in the end :) Quote
AlabamaHit Posted November 4, 2008 Posted November 4, 2008 Re: criminal.php Please Post the problem and solution here please... Just in case someone else has the same problem they will have something to help them fix it :) Quote
jamboy1 Posted November 8, 2008 Posted November 8, 2008 Re: criminal.php I had this problem before, it was because i had crime groups with no crimes in those groups, all you need to do is make sure each group has a crime, then your ok 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.