当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseFactory::create方法代码示例

本文整理汇总了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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_ReadRolesWithStatus.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_ReadRolesForTheAction.php

示例3: setInData

 public function setInData($data)
 {
     $id = $data;
     $query = "DELETE FROM Users WHERE id={$id}";
     $db = DatabaseFactory::create("AAADatabase")->connect();
     $db->SQLQuery($query);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_DeleteUser.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_SearchUsersByName.php

示例5: getOutData

 public function getOutData()
 {
     $id = $this->data;
     $query = "SELECT * FROM Users WHERE id = {$id}";
     $db = DatabaseFactory::create("AAADatabase")->connect();
     return $db->SQLFetchArray($query);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_ReadUserById.php

示例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(*)'];
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_ClientRequestsRowsTotalNumber.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:7,代码来源:D_ClientRequestVerticalBarPlot.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:D_ClientDataConsumptionTable.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:D_CreateRole.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:D_DomainsRequestTableOrdered.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:D_CreateUser.php

示例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)'];
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:D_ClientDataRowsTotalNumber.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:9,代码来源:D_UpdateUser.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:9,代码来源:D_ReadClientIpWithFrequency.php

示例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);
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:9,代码来源:D_UpdateRole.php


注:本文中的DatabaseFactory::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。