Php 在数据库中存储解析后的JSON时遇到的问题

Php 在数据库中存储解析后的JSON时遇到的问题,php,mysql,json,Php,Mysql,Json,我已经解析了我的JSON信息,现在我正试图将其存储在mysql数据库中 当我声明变量时,如下所示: $avatar = "test"; 然后一切都存储在我的数据库中 但当我对代码进行如下更改时: $json_string = 'https://api.ubbo.no/api/player/'.$username.''; $jsondata = file_get_contents($json_string); $obj = json_decode($jsondata,

我已经解析了我的JSON信息,现在我正试图将其存储在mysql数据库中

当我声明变量时,如下所示:

$avatar = "test";
然后一切都存储在我的数据库中

但当我对代码进行如下更改时:

$json_string = 'https://api.ubbo.no/api/player/'.$username.'';  
$jsondata    = file_get_contents($json_string);
$obj         = json_decode($jsondata, true);
$avatarfetch = $obj['figure'];
$avatar      = "<img src='https://www.habbo.fr/habbo-imaging/avatarimage?figure=figure=".$avatarfetch."'>";
$json\u string=>https://api.ubbo.no/api/player/“.$username.”;
$jsondata=file\u get\u contents($json\u string);
$obj=json_decode($jsondata,true);
$avatarfetch=$obj['figure'];
$avatar=“”;
当我试图通过按submit按钮将其插入数据库时,没有插入任何内容


这里遗漏了什么?

显示您的数据库代码。$sql=“在用户(用户名、密码、等级、化身、帖子)中插入值(“$username”、“$password”、“$rank”、“$avatar”、“$posts”)”;读了这篇文章,它会修复它:我不明白,你能简单地解释一下,并给我一个解决方案吗?你的数据库插入代码(很可能是你所有的数据库代码)是开放的SQL注入,它崩溃了,因为你试图插入的html字符串中有
。固定注射也可以解决你的问题。这一联系解释了一切。