0

I have parsed my JSON information and now I am trying to store it in a mysql database.

When I declare the variable as shown below:

$avatar = "test";

Then everything is stored in my database.

But when I made changes to the code as below:

$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."'>";

When I try to insert it by pressing the submit button into the database then nothing is inserted.

What is being missed here?

MyStream
  • 2,533
  • 1
  • 16
  • 33

0 Answers0