Error Info: Array ( [0] => HY000 [1] => 1045 [2] => Access denied for user 'dazzcrea_upcawala'@'localhost' (using password: YES) )
in /home1/ngineers/public_html/upca/upca/vendor/yiisoft/yii2/db/Connection.php at line 687
if ($enableProfiling) { Yii::endProfile($token, __METHOD__); } } catch (\PDOException $e) { if ($enableProfiling) { Yii::endProfile($token, __METHOD__); } throw new Exception($e->getMessage(), $e->errorInfo, (int) $e->getCode(), $e); } } /** * Closes the currently active DB connection. * It does nothing if the connection is already closed. */ public function close() {
* Returns the PDO instance for the currently active master connection. * This method will open the master DB connection and then return [[pdo]]. * @return PDO the PDO instance for the currently active master connection. */ public function getMasterPdo() { $this->open(); return $this->pdo; } /** * Returns the currently active slave connection. * If this method is called for the first time, it will try to open a slave connection when [[enableSlaves]] is true.
* is available and `$fallbackToMaster` is false. */ public function getSlavePdo($fallbackToMaster = true) { $db = $this->getSlave(false); if ($db === null) { return $fallbackToMaster ? $this->getMasterPdo() : null; } return $db->pdo; } /**
public function quoteValue($str) { if (!is_string($str)) { return $str; } if (($value = $this->db->getSlavePdo()->quote($str)) !== false) { return $value; } // the driver doesn't support quote (e.g. oci) return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'"; }
* @param string $value string to be quoted * @return string the properly quoted string * @see http://php.net/manual/en/pdo.quote.php */ public function quoteValue($value) { return $this->getSchema()->quoteValue($value); } /** * Quotes a table name for use in a query. * If the table name contains schema prefix, the prefix will also be properly quoted. * If the table name is already quoted or contains special characters including '(', '[[' and '{{',
$params = []; foreach ($this->params as $name => $value) { if (is_string($name) && strncmp(':', $name, 1)) { $name = ':' . $name; } if (is_string($value)) { $params[$name] = $this->db->quoteValue($value); } elseif (is_bool($value)) { $params[$name] = ($value ? 'TRUE' : 'FALSE'); } elseif ($value === null) { $params[$name] = 'NULL'; } elseif ((!is_object($value) && !is_resource($value)) || $value instanceof Expression) { $params[$name] = $value;
* @return array array of two elements, the first is boolean of whether profiling is enabled or not. * The second is the rawSql if it has been created. */ private function logQuery($category) { if ($this->db->enableLogging) { $rawSql = $this->getRawSql(); Yii::info($rawSql, $category); } if (!$this->db->enableProfiling) { return [false, isset($rawSql) ? $rawSql : null]; }
* @return mixed the method execution result * @throws Exception if the query causes any problem * @since 2.0.1 this method is protected (was private before). */ protected function queryInternal($method, $fetchMode = null) { list($profile, $rawSql) = $this->logQuery('yii\db\Command::query'); if ($method !== '') { $info = $this->db->getQueryCacheInfo($this->queryCacheDuration, $this->queryCacheDependency); if (is_array($info)) { /* @var $cache \yii\caching\CacheInterface */ $cache = $info[0];
* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); } /** * Executes the SQL statement and returns the first row of the result. * This method is best used when only the first row of result is needed for a query. * @param int $fetchMode the result fetch mode. Please refer to [PHP manual](http://php.net/manual/en/pdostatement.setfetchmode.php)
*/ public function all($db = null) { if ($this->emulateExecution) { return []; } $rows = $this->createCommand($db)->queryAll(); return $this->populate($rows); } /** * Converts the raw query results into the format as specified by this query. * This method is internally used to convert the data fetched from database
* @param Connection $db the DB connection used to create the DB command. * If null, the DB connection returned by [[modelClass]] will be used. * @return array|ActiveRecord[] the query results. If the query results in nothing, an empty array will be returned. */ public function all($db = null) { return parent::all($db); } /** * {@inheritdoc} */ public function prepare($builder)
public function actionViewGalleryImages($id) { $photoModel = PhotoList::find() ->asArray() ->where(['photo_id'=>$id]) ->all(); $caption = Photo::findOne($id)->photo_caption; return $this->render('photos',[ 'photoModel'=>$photoModel, 'caption'=>$caption
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require __DIR__ . '/../../common/config/main.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); (new yii\web\Application($config))->run();
$_GET = [ 'id' => '29', ];