title: Unable to Store Base64 Data in MySql Database
body: <p>I am trying to store an Base64 string to my MySql database using PHP. Here is my code.</p>
  
  <pre><code>&lt;?PHP
  //Store Image
  $photoData = $_POST['PhotoData'];
  
  //Database connection details
  $db_url = "192.168.1.140";
  $db_user_name = "easyblogadmin";
  $db_password = "admin";
  $db_name = "easyblog";
  
  $con = mysqli_connect($db_url, $db_user_name, $db_password);
  $sql = "insert into temptable (photodata) values('$photoData')";
  
  if(mysqli_connect_errno()){
          echo "Failed to Connect Database";
          echo mysqli_connect_errno();
          die();
      } else {
          //Connecting to Application Database
          $db_selected = mysqli_select_db($con, $db_name);
          if(!$db_selected){
              echo "Failed to Connect Application Database";
              die();
          } else {
              if (!mysqli_query($con,$sql)) {
                  die('Error: ' . mysqli_error($con));
              }
              mysqli_close($con);
              echo "Successfully Added photo".strlen($photoData);
          }
      }?&gt;
  </code></pre>
  
  <p>Here the $photoData is my Base64 encoded string and I am storing this in my DB. When i am trying to retrieve this data from DB some data in my string is missing. I don't understand why this is happening. Can any one help me out. </p>
  
  <p>regards.</p>