=== Test Ticket Generator === Event: Mohamed Abdo New Years Celebration 2025 (ID: 1)
Illuminate\Database\QueryException {#2036 +errorInfo: array:3 [ 0 => "42S22" 1 => 1054 2 => "Unknown column 'status' in 'WHERE'" ] #sql: "select * from `seats` where `event_id` = ? and `status` = ? limit 12" #bindings: array:2 [ 0 => 1 1 => "available" ] }
// 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. catch (Exception $e) { throw new QueryException( $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()); })); } /** * @return \Illuminate\Database\Eloquent\Model[]|static[] */ public function getModels($columns = ['*']) { return $this->model->hydrate( $this->query->get($columns)->all() )->all(); } /** * Eager load the relationships for the models. $builder = $this->applyScopes(); // If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded, which will solve the // n+1 query issue for the developers to avoid running a lot of queries. if (count($models = $builder->getModels($columns)) > 0) { $models = $builder->eagerLoadRelations($models); } return $builder->getModel()->newCollection($models); }// Get available seats$availableSeats = Seat::where('event_id', $eventId) ->where('status', 'available') ->take($numOrders * $ticketsPerOrder) ->get();if ($availableSeats->count() < $numOrders * $ticketsPerOrder) { echo "Warning: Only {$availableSeats->count()} seats available, adjusting...\n"; $numOrders = floor($availableSeats->count() / $ticketsPerOrder); if ($numOrders < 1) { // 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()); })); } /** * @return \Illuminate\Database\Eloquent\Model[]|static[] */ public function getModels($columns = ['*']) { return $this->model->hydrate( $this->query->get($columns)->all() )->all(); } /** * Eager load the relationships for the models. $builder = $this->applyScopes(); // If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded, which will solve the // n+1 query issue for the developers to avoid running a lot of queries. if (count($models = $builder->getModels($columns)) > 0) { $models = $builder->eagerLoadRelations($models); } return $builder->getModel()->newCollection($models); }// Get available seats$availableSeats = Seat::where('event_id', $eventId) ->where('status', 'available') ->take($numOrders * $ticketsPerOrder) ->get();if ($availableSeats->count() < $numOrders * $ticketsPerOrder) { echo "Warning: Only {$availableSeats->count()} seats available, adjusting...\n"; $numOrders = floor($availableSeats->count() / $ticketsPerOrder); if ($numOrders < 1) {|
[2/2]
QueryException
|
|---|
Illuminate\Database\QueryException:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'WHERE' (SQL: select * from `seats` where `event_id` = 1 and `status` = available limit 12)
at /home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
at Illuminate\Database\Connection->runQueryCallback('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720)
at Illuminate\Database\Connection->run('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:405)
at Illuminate\Database\Connection->select('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), true)
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2705)
at Illuminate\Database\Query\Builder->runSelect()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2694)
at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3230)
at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2693)
at Illuminate\Database\Query\Builder->get(array('*'))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:710)
at Illuminate\Database\Eloquent\Builder->getModels(array('*'))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:694)
at Illuminate\Database\Eloquent\Builder->get()
(/home/globalgala/public_html/2026_backend_dev/scripts/generate-test-tickets.php:52)
|
|
[1/2]
PDOException
|
|---|
PDOException:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'WHERE'
at /home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414
at PDO->prepare('select * from `seats` where `event_id` = ? and `status` = ? limit 12')
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414)
at Illuminate\Database\Connection->Illuminate\Database\{closure}('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:753)
at Illuminate\Database\Connection->runQueryCallback('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720)
at Illuminate\Database\Connection->run('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:405)
at Illuminate\Database\Connection->select('select * from `seats` where `event_id` = ? and `status` = ? limit 12', array(1, 'available'), true)
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2705)
at Illuminate\Database\Query\Builder->runSelect()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2694)
at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3230)
at Illuminate\Database\Query\Builder->onceWithColumns(array('*'), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2693)
at Illuminate\Database\Query\Builder->get(array('*'))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:710)
at Illuminate\Database\Eloquent\Builder->getModels(array('*'))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:694)
at Illuminate\Database\Eloquent\Builder->get()
(/home/globalgala/public_html/2026_backend_dev/scripts/generate-test-tickets.php:52)
|