R!der Posted February 18, 2007 Posted February 18, 2007 I am trying to make it so i can add/edit/delete crimes via the admin panel but i seem to get this error Fatal error: Call to undefined function: crimegroup_dropdown() in /******/*********/******/admin.php on line 2000 This is line 2000 Crime Group: ".crimegroup_dropdown($c,'crimeGROUP')." Does anyone know what this error means and how i can fix it? Quote
lem0n Posted February 18, 2007 Posted February 18, 2007 Re: function error I can see anything wrong with that line of code it is exactly the same as the one i am using are you sure that is the correct line? Quote
spellbyte ® Posted February 18, 2007 Posted February 18, 2007 Re: function error you need to define the crimegroup dropdown in the global_func.php Quote
R!der Posted February 19, 2007 Author Posted February 19, 2007 Re: function error Ah that worked thx :) Quote
Jake Posted February 21, 2007 Posted February 21, 2007 Re: function error Can you tell me how you've done this please. I'm trying to do the same for cars, and gangs...? I can't seem to define it in the global func file. Quote
spellbyte ® Posted February 21, 2007 Posted February 21, 2007 Re: function error Gangs function gang_dropdown($connection,$ddname="gangs",$selected=-1) { $ret="<select name='$ddname' type='dropdown'>"; $q=mysql_query("SELECT * FROM gangs ORDER BY gangNAME ASC",$connection); if($selected == -1) { $first=0; } else { $first=1; } while($r=mysql_fetch_array($q)) { $ret.="\n<option value='{$r['gangID']}'"; if ($selected == $r['gangID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['gangNAME']}</option>"; } $ret.="\n</select>"; return $ret; } Cars function cars_dropdown($connection,$ddname="cars",$selected=-1) { $ret="<select name='$ddname' type='dropdown'>"; $q=mysql_query("SELECT * FROM cars_types ORDER BY carNAME ASC",$connection); if($selected == -1) { $first=0; } else { $first=1; } while($r=mysql_fetch_array($q)) { $ret.="\n<option value='{$r['carID']}'"; if ($selected == $r['carID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['carNAME']}</option>"; } $ret.="\n</select>"; return $ret; } they both depend on the structure of your db though Quote
Jake Posted February 21, 2007 Posted February 21, 2007 Re: function error I'm using lite, and the names in there are incorrect, but im sure i can manage going through and editing the names. Thanks a lot Spellbyte :mrgreen: Quote
Jake Posted February 21, 2007 Posted February 21, 2007 Re: function error Ok, i really don't know how to do this, so how would i turn this into a form...? Quote
spellbyte ® Posted February 21, 2007 Posted February 21, 2007 Re: function error that code i posted above is just the functions that needs to go into global_func.php the form is a totally different and much larger piece of script Quote
Jake Posted February 22, 2007 Posted February 22, 2007 Re: function error yeah i know that. Its ok i just copied a bit from Admin to put into a form 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.