本文整理汇总了PHP中DatabaseFactory::create方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseFactory::create方法的具体用法?PHP DatabaseFactory::create怎么用?PHP DatabaseFactory::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseFactory
的用法示例。
在下文中一共展示了DatabaseFactory::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOutData
public function getOutData()
{
$id = $this->data;
$query = "SELECT roles.*, 1 as status\n FROM roles \n LEFT JOIN users_roles\n ON users_roles.role_id = roles.id\n WHERE users_roles.user_id = {$id}\n\n\t\t\t\t UNION\n\n\t\t\t\t SELECT roles.*, 0 as status\n FROM roles \n WHERE roles.id NOT IN \n (\n \tSELECT roles.id\n\t\t\t \tFROM roles\n\t\t \t \tLEFT JOIN users_roles\n\t\t \tON users_roles.role_id = roles.id\n\t\t \tWHERE users_roles.user_id = {$id}\n\t\t )";
$db = DatabaseFactory::create("AAADatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例2: getOutData
public function getOutData()
{
$actionName = $this->data;
$query = "SELECT roles.*\n FROM roles\n LEFT JOIN roles_actions\n ON roles_actions.role_id = roles.id\n WHERE roles_actions.action_name = '{$actionName}'";
$db = DatabaseFactory::create("AAADatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例3: setInData
public function setInData($data)
{
$id = $data;
$query = "DELETE FROM Users WHERE id={$id}";
$db = DatabaseFactory::create("AAADatabase")->connect();
$db->SQLQuery($query);
}
示例4: getOutData
public function getOutData()
{
$name = $this->data;
$query = "SELECT * FROM Users WHERE name LIKE '%{$name}%'";
$db = DatabaseFactory::create("AAADatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例5: getOutData
public function getOutData()
{
$id = $this->data;
$query = "SELECT * FROM Users WHERE id = {$id}";
$db = DatabaseFactory::create("AAADatabase")->connect();
return $db->SQLFetchArray($query);
}
示例6: getOutData
public function getOutData()
{
$date = $this->data['date'];
$db = DatabaseFactory::create("SquidDatabase")->connect();
$rowsTotalNumberInArray = $db->SQLFetchArray("SELECT COUNT(*)\n FROM SquidData\n WHERE date = '{$date}' ");
return (int) $rowsTotalNumberInArray['COUNT(*)'];
}
示例7: getOutData
public function getOutData()
{
$date = $this->data['date'];
$query = "SELECT client_ip, COUNT(client_ip) as frequency \n FROM SquidData \n \t\t\tWHERE date = '{$date}'\n GROUP BY client_ip \n \t\t\tORDER BY frequency DESC";
$db = DatabaseFactory::create("SquidDatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例8: getOutData
public function getOutData()
{
$clientIp = $this->data['client-ip'];
$date = $this->data['date'];
$query = "SELECT client_data, time, url\n FROM SquidData \n WHERE client_ip = '{$clientIp}' AND date = '{$date}'\n ORDER BY time";
$db = DatabaseFactory::create("SquidDatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例9: setInData
public function setInData($data)
{
$name = $data['name'];
$description = $data['description'];
$query = "INSERT INTO Roles (name, description) VALUES ('{$name}', '{$description}')";
$db = DatabaseFactory::create("AAADatabase")->connect();
$db->SQLQuery($query);
}
示例10: getOutData
public function getOutData()
{
$clientIp = $this->data['client-ip'];
$date = $this->data['date'];
$query = "SELECT url, date, time, COUNT(url) as frequency \n FROM SquidData \n WHERE client_ip = '{$clientIp}' AND date = '{$date}'\n GROUP BY url\n ORDER BY frequency DESC";
$db = DatabaseFactory::create("SquidDatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例11: setInData
public function setInData($data)
{
$name = $data['name'];
$password = $data['password'];
$query = "INSERT INTO Users (name, password) VALUES ('{$name}', '{$password}')";
$db = DatabaseFactory::create("AAADatabase")->connect();
$db->SQLQuery($query);
}
示例12: getOutData
public function getOutData()
{
$clientIp = $this->data['client-ip'];
$date = $this->data['date'];
$db = DatabaseFactory::create("SquidDatabase")->connect();
$rowsTotalNumberInArray = $db->SQLFetchArray("SELECT COUNT(client_data)\n FROM SquidData\n WHERE client_ip = '{$clientIp}' \n AND date = '{$date}'\n ORDER BY time");
return (int) $rowsTotalNumberInArray['COUNT(client_data)'];
}
示例13: setInData
public function setInData($data)
{
$name = $data['name'];
$password = $data['password'];
$id = $data['id'];
$query = "UPDATE Users SET\n name = '{$name}', \n password = '{$password}' \n WHERE id = {$id}";
$db = DatabaseFactory::create("AAADatabase")->connect();
$db->SQLQuery($query);
}
示例14: getOutData
public function getOutData()
{
$paginator = PaginatorFactory::create();
$beginning = $paginator->beginning;
$rowsPerPage = $paginator->rowsPerPage;
$query = "SELECT client_ip, url, COUNT(client_ip) as frequency FROM SquidData \n \t\t\tGROUP BY client_ip \n \t\t\t\tORDER BY frequency DESC \n \t\t\t\t\tLIMIT {$beginning}, {$rowsPerPage}";
$db = DatabaseFactory::create("SquidDatabase")->connect();
return $db->SQLFetchAllArray($query);
}
示例15: setInData
public function setInData($data)
{
$id = $data['id'];
$name = $data['name'];
$description = $data['description'];
$query = "UPDATE Roles SET\n name = '{$name}', \n description = '{$description}' \n WHERE id = {$id}";
$db = DatabaseFactory::create("AAADatabase")->connect();
$db->SQLQuery($query);
}