Checking Felix O'Test data: ✅ Felix found: Ava (felix@avaacquisitions.com)
Illuminate\Database\QueryException {#1646 +errorInfo: array:3 [ 0 => "42S02" 1 => 1146 2 => "Table 'consentangel_consentangel_sgce9.user_modules' doesn't exist" ] +connectionName: "mysql" #sql: "select * from `user_modules` where `user_id` = ?" #bindings: array:1 [ 0 => 7 ] }
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()); })); } /**$felix = App\Models\User::where('name', 'LIKE', '%Felix%')->orWhere('email', 'LIKE', '%felix%')->first();if ($felix) { echo "✅ Felix found: " . $felix->name . " (" . $felix->email . ")\n"; // Check user_modules $modules = DB::table('user_modules')->where('user_id', $felix->id)->get(); echo "User modules: " . $modules->count() . "\n"; foreach ($modules as $module) { echo " - Module " . $module->module_id . ": " . ($module->completed ? 'Completed' : 'Not completed') . "\n"; } // For select statements, we'll simply execute the query and return an array // of the database result set. Each element in the array will be a single // row from the database table, and will either be an array or objects. $statement = $this->prepared( $this->getPdoForSelect($useReadPdo)->prepare($query) ); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); // For select statements, we'll simply execute the query and return an array // of the database result set. Each element in the array will be a single // row from the database table, and will either be an array or objects. $statement = $this->prepared( $this->getPdoForSelect($useReadPdo)->prepare($query) ); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); { // 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()); })); } /**$felix = App\Models\User::where('name', 'LIKE', '%Felix%')->orWhere('email', 'LIKE', '%felix%')->first();if ($felix) { echo "✅ Felix found: " . $felix->name . " (" . $felix->email . ")\n"; // Check user_modules $modules = DB::table('user_modules')->where('user_id', $felix->id)->get(); echo "User modules: " . $modules->count() . "\n"; foreach ($modules as $module) { echo " - Module " . $module->module_id . ": " . ($module->completed ? 'Completed' : 'Not completed') . "\n"; } |
[2/2]
QueryException
|
|---|
Illuminate\Database\QueryException:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'consentangel_consentangel_sgce9.user_modules' doesn't exist (Connection: mysql, SQL: select * from `user_modules` where `user_id` = 7)
at /home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829
at Illuminate\Database\Connection->runQueryCallback('select * from `user_modules` where `user_id` = ?', array(7), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:783)
at Illuminate\Database\Connection->run('select * from `user_modules` where `user_id` = ?', array(7), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414)
at Illuminate\Database\Connection->select('select * from `user_modules` where `user_id` = ?', array(7), true)
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2913)
at Illuminate\Database\Query\Builder->runSelect()
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2902)
at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3456)
at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2901)
at Illuminate\Database\Query\Builder->get()
(/home/consentangel/public_html/sgce/009/check_felix_data.php:15)
|
|
[1/2]
PDOException
|
|---|
PDOException:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'consentangel_consentangel_sgce9.user_modules' doesn't exist
at /home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423
at PDO->prepare('select * from `user_modules` where `user_id` = ?')
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:423)
at Illuminate\Database\Connection->Illuminate\Database\{closure}('select * from `user_modules` where `user_id` = ?', array(7))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:816)
at Illuminate\Database\Connection->runQueryCallback('select * from `user_modules` where `user_id` = ?', array(7), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:783)
at Illuminate\Database\Connection->run('select * from `user_modules` where `user_id` = ?', array(7), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414)
at Illuminate\Database\Connection->select('select * from `user_modules` where `user_id` = ?', array(7), true)
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2913)
at Illuminate\Database\Query\Builder->runSelect()
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2902)
at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3456)
at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
(/home/consentangel/public_html/sgce/009/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2901)
at Illuminate\Database\Query\Builder->get()
(/home/consentangel/public_html/sgce/009/check_felix_data.php:15)
|