mercredi 9 août 2023

Error "Whoops, looks like something went wrong." in Laravel page

First of all thank you very much for reading me and helping me in this as I am a newbie in laravel.

I have done a deployment of a website given to me by a company and everything works except the search in the post_categories table in the database.

When I enter a link that performs a query to the database to get all the posts of that category I get the following error (In this case for category 13):

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>'$. "en"' asc' at line 1 (SQL: select * from `post_categories` where `post_categories`.`parent_id` = 13 and `post_categories`.`parent_id` is not null order by `title`->'$. "en"' asc)

However, if I go directly to any post in that category it is perfectly visible, so it is affecting only the search engine.

The error is caused because the title->'$. "es"' part doesn't seem to work, but I don't know why, since the query is generated directly from here as far as I can tell from reading the code.

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
            // 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();

            return $statement->fetchAll();
        });
    }

I thought that maybe it is failing some php variable that is not being defined well, but I have not touched any of the code since I have only deployed and the web, on the company's server, makes the search correctly.

Would anyone know how to guide me to solve this error?

Thank you all!

all the data and evidence have been provided above



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/BOGudpx
via IFTTT

Aucun commentaire:

Enregistrer un commentaire