Array ( ) SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "masjid" does not exist LINE 1: select count(*) as aggregate from "masjid" ^ (Connection: pgsql, SQL: select count(*) as aggregate from "masjid") (500 Internal Server Error)

Symfony Exception

PDOException QueryException

HTTP 500 Internal Server Error

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "masjid" does not exist
LINE 1: select count(*) as aggregate from "masjid"
^ (Connection: pgsql, SQL: select count(*) as aggregate from "masjid")

Exceptions 2

Illuminate\Database\ QueryException

Show exception properties
Illuminate\Database\QueryException {#27
  +errorInfo: array:3 [
    0 => "42P01"
    1 => 7
    2 => """
      ERROR:  relation "masjid" does not exist\n
      LINE 1: select count(*) as aggregate from "masjid"\n
                                                ^
      """
  ]
  +connectionName: "pgsql"
  #sql: "select count(*) as aggregate from "masjid""
  #bindings: []
}
  1. throw new UniqueConstraintViolationException(
  2. $this->getName(), $query, $this->prepareBindings($bindings), $e
  3. );
  4. }
  5. throw new QueryException(
  6. $this->getName(), $query, $this->prepareBindings($bindings), $e
  7. );
  8. }
  9. }
  1. // Here we will run this query. If an exception occurs we'll determine if it was
  2. // caused by a connection that has been lost. If that is the cause, we'll try
  3. // to re-establish connection and re-run the query with a fresh connection.
  4. try {
  5. $result = $this->runQueryCallback($query, $bindings, $callback);
  6. } catch (QueryException $e) {
  7. $result = $this->handleQueryException(
  8. $e, $query, $bindings, $callback
  9. );
  10. }
  1. * @param bool $useReadPdo
  2. * @return array
  3. */
  4. public function select($query, $bindings = [], $useReadPdo = true)
  5. {
  6. return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
  7. if ($this->pretending()) {
  8. return [];
  9. }
  10. // For select statements, we'll simply execute the query and return an array
  1. *
  2. * @return array
  3. */
  4. protected function runSelect()
  5. {
  6. return $this->connection->select(
  7. $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  8. );
  9. }
  10. /**
  1. * @return \Illuminate\Support\Collection
  2. */
  3. public function get($columns = ['*'])
  4. {
  5. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  6. return $this->processor->processSelect($this, $this->runSelect());
  7. }));
  8. }
  9. /**
  10. * Run the query as a "select" statement against the connection.
in /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php -> {closure:Illuminate\Database\Query\Builder::get():2901} (line 3456)
  1. if (is_null($original)) {
  2. $this->columns = $columns;
  3. }
  4. $result = $callback();
  5. $this->columns = $original;
  6. return $result;
  7. }
  1. * @param array|string $columns
  2. * @return \Illuminate\Support\Collection
  3. */
  4. public function get($columns = ['*'])
  5. {
  6. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  7. return $this->processor->processSelect($this, $this->runSelect());
  8. }));
  9. }
  10. /**
  1. public function aggregate($function, $columns = ['*'])
  2. {
  3. $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns'])
  4. ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select'])
  5. ->setAggregate($function, $columns)
  6. ->get($columns);
  7. if (! $results->isEmpty()) {
  8. return array_change_key_case((array) $results[0])['aggregate'];
  9. }
  10. }
  1. * @param \Illuminate\Contracts\Database\Query\Expression|string $columns
  2. * @return int
  3. */
  4. public function count($columns = '*')
  5. {
  6. return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns));
  7. }
  8. /**
  9. * Retrieve the minimum value of a given column.
  10. *
  1. <?php
  2. require 'vendor/autoload.php';
  3. $app = require 'bootstrap/app.php';
  4. print_r(Illuminate\Support\Facades\Schema::getColumnListing('masjid'));
  5. $count = Illuminate\Support\Facades\DB::table('masjid')->count();
  6. echo "Total masjids: $count\n";

PDOException

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "masjid" does not exist LINE 1: select count(*) as aggregate from "masjid" ^

  1. $this->getPdoForSelect($useReadPdo)->prepare($query)
  2. );
  3. $this->bindValues($statement, $this->prepareBindings($bindings));
  4. $statement->execute();
  5. return $statement->fetchAll();
  6. });
  7. }
  1. $this->getPdoForSelect($useReadPdo)->prepare($query)
  2. );
  3. $this->bindValues($statement, $this->prepareBindings($bindings));
  4. $statement->execute();
  5. return $statement->fetchAll();
  6. });
  7. }
in /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php -> {closure:Illuminate\Database\Connection::select():414} (line 816)
  1. {
  2. // To execute the statement, we'll simply call the callback, which will actually
  3. // run the SQL against the PDO connection. Then we can calculate the time it
  4. // took to execute and log the query SQL, bindings and time in our memory.
  5. try {
  6. return $callback($query, $bindings);
  7. }
  8. // If an exception occurs when attempting to run a query, we'll format the error
  9. // message to include the bindings with SQL, which will make this exception a
  10. // lot more helpful to the developer instead of just the database's errors.
  1. // Here we will run this query. If an exception occurs we'll determine if it was
  2. // caused by a connection that has been lost. If that is the cause, we'll try
  3. // to re-establish connection and re-run the query with a fresh connection.
  4. try {
  5. $result = $this->runQueryCallback($query, $bindings, $callback);
  6. } catch (QueryException $e) {
  7. $result = $this->handleQueryException(
  8. $e, $query, $bindings, $callback
  9. );
  10. }
  1. * @param bool $useReadPdo
  2. * @return array
  3. */
  4. public function select($query, $bindings = [], $useReadPdo = true)
  5. {
  6. return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
  7. if ($this->pretending()) {
  8. return [];
  9. }
  10. // For select statements, we'll simply execute the query and return an array
  1. *
  2. * @return array
  3. */
  4. protected function runSelect()
  5. {
  6. return $this->connection->select(
  7. $this->toSql(), $this->getBindings(), ! $this->useWritePdo
  8. );
  9. }
  10. /**
  1. * @return \Illuminate\Support\Collection
  2. */
  3. public function get($columns = ['*'])
  4. {
  5. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  6. return $this->processor->processSelect($this, $this->runSelect());
  7. }));
  8. }
  9. /**
  10. * Run the query as a "select" statement against the connection.
in /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php -> {closure:Illuminate\Database\Query\Builder::get():2901} (line 3456)
  1. if (is_null($original)) {
  2. $this->columns = $columns;
  3. }
  4. $result = $callback();
  5. $this->columns = $original;
  6. return $result;
  7. }
  1. * @param array|string $columns
  2. * @return \Illuminate\Support\Collection
  3. */
  4. public function get($columns = ['*'])
  5. {
  6. return collect($this->onceWithColumns(Arr::wrap($columns), function () {
  7. return $this->processor->processSelect($this, $this->runSelect());
  8. }));
  9. }
  10. /**
  1. public function aggregate($function, $columns = ['*'])
  2. {
  3. $results = $this->cloneWithout($this->unions || $this->havings ? [] : ['columns'])
  4. ->cloneWithoutBindings($this->unions || $this->havings ? [] : ['select'])
  5. ->setAggregate($function, $columns)
  6. ->get($columns);
  7. if (! $results->isEmpty()) {
  8. return array_change_key_case((array) $results[0])['aggregate'];
  9. }
  10. }
  1. * @param \Illuminate\Contracts\Database\Query\Expression|string $columns
  2. * @return int
  3. */
  4. public function count($columns = '*')
  5. {
  6. return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns));
  7. }
  8. /**
  9. * Retrieve the minimum value of a given column.
  10. *
  1. <?php
  2. require 'vendor/autoload.php';
  3. $app = require 'bootstrap/app.php';
  4. print_r(Illuminate\Support\Facades\Schema::getColumnListing('masjid'));
  5. $count = Illuminate\Support\Facades\DB::table('masjid')->count();
  6. echo "Total masjids: $count\n";

Stack Traces 2

[2/2] QueryException
Illuminate\Database\QueryException:
SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "masjid" does not exist
LINE 1: select count(*) as aggregate from "masjid"
                                          ^ (Connection: pgsql, SQL: select count(*) as aggregate from "masjid")

  at /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:829
  at Illuminate\Database\Connection->runQueryCallback('select count(*) as aggregate from "masjid"', array(), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:783)
  at Illuminate\Database\Connection->run('select count(*) as aggregate from "masjid"', array(), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:414)
  at Illuminate\Database\Connection->select('select count(*) as aggregate from "masjid"', array(), true)
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2913)
  at Illuminate\Database\Query\Builder->runSelect()
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2902)
  at Illuminate\Database\Query\Builder->{closure:Illuminate\Database\Query\Builder::get():2901}()
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3456)
  at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2901)
  at Illuminate\Database\Query\Builder->get(array('*'))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3383)
  at Illuminate\Database\Query\Builder->aggregate('count', array('*'))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3311)
  at Illuminate\Database\Query\Builder->count()
     (/home/vzizxmil/public_html/banyal-connect-api/check_masjid_table.php:5)                
[1/2] PDOException
PDOException:
SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "masjid" does not exist
LINE 1: select count(*) as aggregate from "masjid"
                                          ^

  at /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:428
  at PDOStatement->execute()
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:428)
  at Illuminate\Database\Connection->{closure:Illuminate\Database\Connection::select():414}('select count(*) as aggregate from "masjid"', array())
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:816)
  at Illuminate\Database\Connection->runQueryCallback('select count(*) as aggregate from "masjid"', array(), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:783)
  at Illuminate\Database\Connection->run('select count(*) as aggregate from "masjid"', array(), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:414)
  at Illuminate\Database\Connection->select('select count(*) as aggregate from "masjid"', array(), true)
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2913)
  at Illuminate\Database\Query\Builder->runSelect()
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2902)
  at Illuminate\Database\Query\Builder->{closure:Illuminate\Database\Query\Builder::get():2901}()
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3456)
  at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:2901)
  at Illuminate\Database\Query\Builder->get(array('*'))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3383)
  at Illuminate\Database\Query\Builder->aggregate('count', array('*'))
     (/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Query/Builder.php:3311)
  at Illuminate\Database\Query\Builder->count()
     (/home/vzizxmil/public_html/banyal-connect-api/check_masjid_table.php:5)