Jump to content


Make the Missing Database


1 reply to this topic

#1 Vic Vance

    Young Padawan

  • Members
  • Pip
  • 20 posts

Posted 06 July 2008 - 04:33 PM

I got a site that has an admin panel, witch is missing an import database, I am quite new to this, I dont really know now to make the mission SQL query, Can I get Help On this. It is calling form an funtion at the moment in my ACP it says this Table 'a2900139_gta.admin_perms' doesn't exis. Here is the codes




class FUNC {



 

 var $AdminInfo = array();
 var $output = "";
 var 

$AccessGranted = true;
 



 

 function FUNC() {
   
  global $mid, 

$session, $act;
  
  $GetPerms = mysql_query("SELECT 

ap.mbr_id, ap.perms, p.id as perm_ids, p.pages, m.id, m.mbr_group FROM 

admin_perms ap, admin_permissions p, members m WHERE ap.mbr_id = '$mid' 

&& (m.mbr_group = 1 || m.mbr_group = 12 ||  m.mbr_group = 6 || 

m.mbr_group = 7) && m.id = '$mid'")or 

die(mysql_error());
  
  while ($row = 

mysql_fetch_assoc($GetPerms)) 

{
    
   $Perms = 

substr($row['perms'], 0, -1); // Knock off the last comma so we don't have a 0 

in our array
   $Perms = split(",", 

$Perms);
 
   if (@in_array($row['perm_ids'], $Perms)) 

{



 

    $AccessPages .= $row['pages']; 



 

   }
   
   if 

(@in_array(0, $Perms)) 

{
   
    $AccessPages = 

"All";
   
   }


From Looking at that I can tell there is 2 tables one called admin_perms and one called admi_permission. Can I get help in taking that information and making it in to a SQL query

thanks

#2 PurdueKenny

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 21 July 2008 - 10:53 PM

Do you know all of the fields that are required for the admin table?

For instance, ONE of possibly many is mbr_id...mbr_id is probably the primary key. It also looks like you'll be using a mysql database...so

CREATE TABLE admin_perms(
mbr_id varchar(50) PRIMARY KEY);

If you want additional fields you would do it something like:

CREATE TABLE customer
(First_Name char(50),
Field_Name char(50),
Last_Name char(50)
)

notice the last parameter doesn't have a , after.

There is no telling what all of the parameters it had though. Or what it's looking for with values in those, only the creator would know.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users