I saw some netizens saying that using PHP is a suitable solution to save Qujiang json data into mysql. I would like to ask how to save json format data into mysql.
If you want to store json data in PHP into a mysql database, you must first use PHP to serialize and filter it, and then store it in the database
The specific code is as follows:
$data = json_encode($array);// 过滤 $data = addslashes($data);// 入库 $db->insert( $table_name,array( 'field' => $data, ));
The above is the detailed content of How to store json data in php to mysql?. For more information, please follow other related articles on the PHP Chinese website!