m trying to extract data from json in mysql: my sample mysql query is : I already tried using below code , but its returning null vales , But i have value in database . In the below code column_name1 and er_trading_sales is column name and table_name is the name of the table
SELECT column_name1 as column_name1,
substring(
er_trading_sales,
locate('"C2":{"type":"label","value":"":{"m":"label","k":"(a) to registered dealers","v":"}","C3": { "type":"textbox","value":"',er_trading_sales,locate('"Trading_B_I"',er_trading_s ales))+70,
(locate('"},"C4',er_trading_sales,locate('"C2":{"type":"label","value":"":{"m":"label","k":"(a) to registered dealers","v":"}","C3":{"type":"textbox","value":"',er_trading_sales,locate('"Trading_B_I"',er_trading_sales))) - (locate('"C2":{"type":"label","value":"":{"m":"label","k":"(a) to registered dealers","v":"}","C3": {"type":"textbox","value":"',er_trading_sales,locate('"Trading_B_I"',er_trading_ sales))+70))
) as TradingAmount
from table_name
//sample json
"R10" => array(
"col_data" => array(
"CR1" => array(
"C1" => array(
"type" => "label",
"value" => "8.",
),
"C2" => array(
"type" => "complex",
"value" => array(
"m" => "label",
"k" => "Turnover of sale of goods taxable @ ^d^%",
"v" => "4.5"
),
),
"C3" => array(
"type" => "textbox",
"value" => "",
"validation" => "decimal",
),
"C4" => array(
"type" => "textbox",
"value" => "",
"validation" => "decimal",
'htmlOptions' => array('readonly' => 'readonly'),
),
"C5" => array(
"type" => "",
"value" => "",
),
),
),
),
i want "value" of "C3" => array(
"type" => "textbox",
"value" => "",
"validation" => "decimal",
)