簡體   English   中英

我想在從 sql 獲得的 json 中插入新值

[英]I want insert new value in json which get from sql

$query2 = "SELECT distinct
                n.id AS 'channel_id',
                n.category_id,
                n.channel_name,
                n.channel_image,
                n.channel_url AS 'channel_url',
                n.channel_description,
                n.channel_type,
                n.video_id,
                c.category_name
            FROM
                tbl_channel n,
                tbl_category c

            WHERE
                n.category_id = c.cid AND c.cid = '$id' 
            ORDER BY n.id DESC 
            LIMIT $limit OFFSET $offset";
    ";

我想在通道 url 中插入新值

例如:我得到了 output channel_urlhttps://edge.okezone.com/live/life.m3u8但在這里我想在 Z572D4E421E5AE6B9BC11D815E8 的末尾插入一個新值

您可以連接 output

$row['channel_url'] .= "new value";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM