stdClass Object ( [id] => 151 [name] => Masjid Izzul Allawi [email] => mia@app.com [phone] => 6281224992721 [password] => $2y$12$SsQYng1rEHnbmwpB1zjCIOFfUgbSNi8nQY7ZnQf.zeM2O9Y2.P5Wa [role] => inkubator [status] => active [created_at] => 2026-03-27 09:38:36.688491 )
Illuminate\Database\QueryException {#60 +errorInfo: array:3 [ 0 => "42P01" 1 => 7 2 => """ ERROR: relation "masjid" does not exist\n LINE 1: select * from "masjid" where "user_id" = $1 limit 1\n ^ """ ] +connectionName: "pgsql" #sql: "select * from "masjid" where "user_id" = ? limit 1" #bindings: array:1 [ 0 => 151 ] }
throw new UniqueConstraintViolationException( $this->getName(), $query, $this->prepareBindings($bindings), $e ); } throw new QueryException( $this->getName(), $query, $this->prepareBindings($bindings), $e ); } } // Here we will run this query. If an exception occurs we'll determine if it was // caused by a connection that has been lost. If that is the cause, we'll try // to re-establish connection and re-run the query with a fresh connection. try { $result = $this->runQueryCallback($query, $bindings, $callback); } catch (QueryException $e) { $result = $this->handleQueryException( $e, $query, $bindings, $callback ); } * @param bool $useReadPdo * @return array */ public function select($query, $bindings = [], $useReadPdo = true) { return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { if ($this->pretending()) { return []; } // For select statements, we'll simply execute the query and return an array * * @return array */ protected function runSelect() { return $this->connection->select( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); } /** * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { return collect($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); } /** * Run the query as a "select" statement against the connection. if (is_null($original)) { $this->columns = $columns; } $result = $callback(); $this->columns = $original; return $result; } * @param array|string $columns * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { return collect($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); } /** * @param array|string $columns * @return \Illuminate\Database\Eloquent\Model|object|static|null */ public function first($columns = ['*']) { return $this->take(1)->get($columns)->first(); } /** * Execute the query and get the first result if it's the sole matching record. *<?phprequire 'vendor/autoload.php';$app = require 'bootstrap/app.php';$user = Illuminate\Support\Facades\DB::table('users')->where('id', 151)->first();print_r($user);$masjid = Illuminate\Support\Facades\DB::table('masjid')->where('user_id', 151)->first();print_r($masjid); $this->getPdoForSelect($useReadPdo)->prepare($query) ); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); return $statement->fetchAll(); }); } $this->getPdoForSelect($useReadPdo)->prepare($query) ); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); return $statement->fetchAll(); }); } { // To execute the statement, we'll simply call the callback, which will actually // run the SQL against the PDO connection. Then we can calculate the time it // took to execute and log the query SQL, bindings and time in our memory. try { return $callback($query, $bindings); } // If an exception occurs when attempting to run a query, we'll format the error // message to include the bindings with SQL, which will make this exception a // lot more helpful to the developer instead of just the database's errors. // Here we will run this query. If an exception occurs we'll determine if it was // caused by a connection that has been lost. If that is the cause, we'll try // to re-establish connection and re-run the query with a fresh connection. try { $result = $this->runQueryCallback($query, $bindings, $callback); } catch (QueryException $e) { $result = $this->handleQueryException( $e, $query, $bindings, $callback ); } * @param bool $useReadPdo * @return array */ public function select($query, $bindings = [], $useReadPdo = true) { return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { if ($this->pretending()) { return []; } // For select statements, we'll simply execute the query and return an array * * @return array */ protected function runSelect() { return $this->connection->select( $this->toSql(), $this->getBindings(), ! $this->useWritePdo ); } /** * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { return collect($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); } /** * Run the query as a "select" statement against the connection. if (is_null($original)) { $this->columns = $columns; } $result = $callback(); $this->columns = $original; return $result; } * @param array|string $columns * @return \Illuminate\Support\Collection */ public function get($columns = ['*']) { return collect($this->onceWithColumns(Arr::wrap($columns), function () { return $this->processor->processSelect($this, $this->runSelect()); })); } /** * @param array|string $columns * @return \Illuminate\Database\Eloquent\Model|object|static|null */ public function first($columns = ['*']) { return $this->take(1)->get($columns)->first(); } /** * Execute the query and get the first result if it's the sole matching record. *<?phprequire 'vendor/autoload.php';$app = require 'bootstrap/app.php';$user = Illuminate\Support\Facades\DB::table('users')->where('id', 151)->first();print_r($user);$masjid = Illuminate\Support\Facades\DB::table('masjid')->where('user_id', 151)->first();print_r($masjid);|
[2/2]
QueryException
|
|---|
Illuminate\Database\QueryException:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "masjid" does not exist
LINE 1: select * from "masjid" where "user_id" = $1 limit 1
^ (Connection: pgsql, SQL: select * from "masjid" where "user_id" = 151 limit 1)
at /home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:829
at Illuminate\Database\Connection->runQueryCallback('select * from "masjid" where "user_id" = ? limit 1', array(151), object(Closure))
(/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:783)
at Illuminate\Database\Connection->run('select * from "masjid" where "user_id" = ? limit 1', array(151), object(Closure))
(/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:414)
at Illuminate\Database\Connection->select('select * from "masjid" where "user_id" = ? limit 1', array(151), 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/Concerns/BuildsQueries.php:333)
at Illuminate\Database\Query\Builder->first()
(/home/vzizxmil/public_html/banyal-connect-api/debug_masjid_fk.php:6)
|
|
[1/2]
PDOException
|
|---|
PDOException:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "masjid" does not exist
LINE 1: select * from "masjid" where "user_id" = $1 limit 1
^
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 * from "masjid" where "user_id" = ? limit 1', array(151))
(/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:816)
at Illuminate\Database\Connection->runQueryCallback('select * from "masjid" where "user_id" = ? limit 1', array(151), object(Closure))
(/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:783)
at Illuminate\Database\Connection->run('select * from "masjid" where "user_id" = ? limit 1', array(151), object(Closure))
(/home/vzizxmil/public_html/banyal-connect-api/vendor/illuminate/database/Connection.php:414)
at Illuminate\Database\Connection->select('select * from "masjid" where "user_id" = ? limit 1', array(151), 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/Concerns/BuildsQueries.php:333)
at Illuminate\Database\Query\Builder->first()
(/home/vzizxmil/public_html/banyal-connect-api/debug_masjid_fk.php:6)
|