Exception
Exception thrown with message "Database error: Please check the "Database Query Error" details below" Stacktrace: #6 Exception in /home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Database.php:160 #5 PMCOM\Core\Database:died in /home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Database.php:496 #4 PMCOM\Core\Database:query_unique in /home/forge/bondit.staging.testing.pm/src/PMCOM/Front/Product.php:55 #3 PMCOM\Front\Product:exists in /home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php:194 #2 PMCOM\Core\Router:_get_route in /home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php:236 #1 call_user_func_array in /home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php:236 #0 PMCOM\Core\Router:__callStatic in /home/forge/bondit.staging.testing.pm/index.php:119

Database error: Please check the "Database Query Error" details below

Stack frames (7):
6 Exception
…/­src/­PMCOM/­Core/­Database.php160
5 PMCOM\Core\Database died
…/­src/­PMCOM/­Core/­Database.php496
4 PMCOM\Core\Database query_unique
…/­src/­PMCOM/­Front/­Product.php55
3 PMCOM\Front\Product exists
…/­src/­PMCOM/­Core/­Router.php194
2 PMCOM\Core\Router _get_route
…/­src/­PMCOM/­Core/­Router.php236
1 call_user_func_array
…/­src/­PMCOM/­Core/­Router.php236
0 PMCOM\Core\Router __callStatic
…/­index.php119
/home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Database.php
 
		$run     = new \Whoops\Run;
		$handler = new \PMCOM\Core\PurposeHandler;
		$handler->addDataTable( 'Database Query Error', array(
		    'Error' => $error,
		    'Query' => $query
		));
		$run->pushHandler($handler);
		$run->register();
		Throw new \Exception( 'Database error: Please check the "Database Query Error" details below' );
	}
 
	/**
	 * [exists description]
	 * @param  [type] $table  [description]
	 * @param  array  $perams [description]
	 * @return [type]         [description]
	 */
	function exists( $table, $perams = array() )
	{
/home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Database.php
	 * Execute a standard sql query to return one result
	 *
	 * @param string $query sql query
	 * @return array of objects
	 */
	function query_unique($query)
	{
		$query .= ' LIMIT 1';
		if( ! $this->lastResult = self::$instance->query( $query ) ) {
			self::died( self::$instance->error, $query );
		}
		if ( $this->lastResult->num_rows > 0 ) return $this->lastResult->fetch_object();
	}
 
	/**
	 * Get a subset of all items
	 *
	 * @param string $table The value of the table
	 * @param array $args values to filter by
	 * @return array of objects
/home/forge/bondit.staging.testing.pm/src/PMCOM/Front/Product.php
	*
	* @param string $slug
	* @return boolen
	*/
	function exists($slug)
	{
		$site_id = SITE;
		$product = $this->database->query_unique("SELECT products.*, product_sites.name as site_name
			FROM product_sites INNER JOIN products ON product_sites.product_id = products.id
			WHERE site_id = $site_id AND status = 1 AND (products.slug = '$slug' OR product_sites.slug = '$slug') GROUP By products.id ORDER BY products.sort ASC");
 
		$prod = new STDclass();
		if( $product ) {
			$prod->has_stock = $product->unlimited_stock == 1 ? 1 : $this->check_stock($product->id);
			if( $prod->has_stock || ( ! $prod->has_stock && $product->display_not_in_stock ) ) {
				return TRUE;
			} else {
				return FALSE;
			}
		} else {
/home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php
					$method = array_reverse( $segments )[0];
				} elseif( $method === 'index' ) {
					$method = $class;
				}
 
 
				foreach( $controllers as $controller ) :
					try {
						$routed = $this->container->get( $controller );
						if( $routed->exists( $method ) ) :
							die( $routed->view( $method ) );
						endif;
					} catch( \Orno\Di\Exception\ReflectionException $e ) {}
				endforeach;
			endif;
		endif;
		// Show 404
		die( call_user_func_array( array( $this->container->get( 'PMCOM\Core\View' ), '_show404' ), $segments ) );
 
	}
/home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
/home/forge/bondit.staging.testing.pm/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
/home/forge/bondit.staging.testing.pm/index.php
|---------------------------------------------------------------
| LOAD THE ROUTES CLASS
|---------------------------------------------------------------
|
| And away we go...
|
*/
 
if( ! $disableRouter ) {
	PMCOM\Core\Router::get_route( $container );
} else {
	PMCOM\Core\Router::setContainer( $container );
}
 

Environment & details:

Key Value
Error Unknown column 'e.imageSrc' in 'where clause'
Query SELECT products.*, product_sites.name as site_name FROM product_sites INNER JOIN products ON product_sites.product_id = products.id WHERE site_id = 1 AND status = 1 AND (products.slug = ''+e.imageSrc+'' OR product_sites.slug = ''+e.imageSrc+'') GROUP By products.id ORDER BY products.sort ASC LIMIT 1
empty
empty
empty
empty
empty
Key Value
USER forge
HOME /home/forge
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_HOST bondit.staging.testing.pm
REDIRECT_STATUS 200
HTTPS on
SERVER_NAME bondit.staging.testing.pm
SERVER_PORT 443
SERVER_ADDR 159.65.17.230
REMOTE_PORT 44072
REMOTE_ADDR 18.118.171.20
SERVER_SOFTWARE nginx/1.13.6
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /home/forge/bondit.staging.testing.pm
DOCUMENT_URI /index.php
REQUEST_URI /themes/bond/assets/js/'+e.imageSrc+'
SCRIPT_NAME /index.php
SCRIPT_FILENAME /home/forge/bondit.staging.testing.pm/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1715269881.4709
REQUEST_TIME 1715269881
empty
0. PMCOM\Core\PurposeHandler