Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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?

Posted

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.

Posted

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

Posted

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:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...