有人能帮助我使用PHP解决以下问题吗


Can anyone help me to fix the following issues using PHP

  1. 如何从数据库中的blob数据转换为图像

2.则转换后的图像应存储到本地机器中用户指定的位置。

答案:

          $sql="select * from new_table where imageId='9'";
          $result=mysqli_Query($con,$sql);
          $row=mysqli_num_rows($result);
          while ($row = mysqli_fetch_Array($result))
              {
                  $image= $row['imageData'];
                  $decoded=base64_decode($image);
                  $name='File2.dwg';
              }
              file_put_contents($path."/".$name, $decoded);