title: store image into Mysql database with url
body: <p>i have inserting url of images into database table :first of all , the image is uploaded into a folder named uploads ( it is a sub folder of an other one named projet) in the server ( i'm using actually 000.webhost.com) , after that inserted in the table , the format of url actually is like that ( uploads/1494162719350.jpg).How Could i change the target_path( in the php code below) in order to obatin an url like(<a href="https://stationpfe.000webhostapp.com/projet/uploads/1494194541508.jpg" rel="nofollow noreferrer">https://stationpfe.000webhostapp.com/projet/uploads/1494194541508.jpg</a> ).
  here is the structure of folders in the server .
  <a href="https://i.stack.imgur.com/RUEtb.png" rel="nofollow noreferrer">structure of folders</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  header('Access-Control-Allow-Origin: *');
  require_once("db_connect.php");
  $target_path = "uploads/";
  if(isset($_FILES['file']))
  {
  $target_path = $target_path . basename( $_FILES['file']['name']);
   
  if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path))  
  {
  //$image=basename( $_FILES["file"]["tmp_name"],".jpg"); // used to store the filename in a variable
  
  //storind the data in your database
  //$QueryInsertFile="INSERT INTO TableName SET ImageColumnName='$target_path'"; 
  $query= "INSERT INTO items SET pic='$target_path'";
  mysqli_query($con,$query);
  echo "success";
  } else 
  {
  echo $target_path;
  echo "There was an error uploading the file, please try again!";
  }
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>