V
V
Vasyl Vandych2021-11-10 22:17:48
MySQL
Vasyl Vandych, 2021-11-10 22:17:48

How to pull data from mysql {title} cell?

I have data in mysql database.
I pull out everything in the links table without any problems.
But how to pull the data located in {"title":12321,} ?

Here's a code example:

SELECT
                `links`.*, `links`.`settings` AS title, `users`.`name` AS `user_name`, `users`.`email` AS `user_email`, `domains`.`scheme`, `domains`.`host`
            FROM
                `links`
            LEFT JOIN
                `users` ON `links`.`user_id` = `users`.`user_id`
            LEFT JOIN
                `domains` ON `links`.`domain_id` = `domains`.`domain_id`
            WHERE
                1 = 1
                {$filters->get_sql_where('links')}
                {$filters->get_sql_order_by('links')}
                {$paginator->get_sql_limit()}


Everything outputs fine via <?= $row->location_url ?> and so on.

But how to display only the title from the settings column?

618c1ac7e567f976595217.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-11-10
@glossyweb

There JSON
echo json_decode($settings)->title;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question