Q:

Storing and Retrieving image path in database mysql php

I am developing a website using PHP, mysql and phpmyadmin. I have some database that I what want to retrieve it in html using PHP and mysql. I want to know how I can store and retrieve image paths from database and display it. I saw on the internet that there is a way, such as using the filesystem to store and retrieve images or making my laptop a server.
what is the best way and how?
I would be grateful for any help, Thanks.

A:

Since, you didn't described your question properly or didn't provided any code.
So, i assumed your question in my way and posted my answer.
Follow the step. 
1) For Uploading Image
<form method='POST' action='UploadImage.php' enctype="multipart/form-data">
    <input type='file' name='UploadImage'>
    <input type='submit' value="submit">
</form>

Suppose your Project Folder Name Is : MyProject (Where all project files are present),
Make one folder inside "MyProject" Folder namely "MyUploadImages"
Now,
UploadImage.php
<?php
include('connect.php'); // Do Database Connection in this file (create a file namely connect.php inside MyProject Folder)
extract($_POST);

$UploadedFileName=$_FILES['UploadImage']['name'];
if($UploadedFileName!='')
{
  $upload_directory = "MyUploadImages/"; //This is the folder which you created just now
  $TargetPath=time().$UploadedFileName;
  if(move_uploaded_file($_FILES['files']['tmp_name'], $upload_directory.$TargetPath)){    
    $QueryInsertFile="INSERT INTO TableName SET ImageColumnName='$TargetPath'"; 
    // Write Mysql Query Here to insert this $QueryInsertFile   .                   
  }
}
?>

Now, In your Database Table, you can find ImageColumnName that image path is set as MyUploadImages/1417Flower.jpg
2) Retreiving Image from database
AnyPage.php
<?
$Query="SELECT * FROM TableName";
// Write mysql query to fetch $Query

store that ImageColumnName value to any variable say $MyPhoto.
?>

<img src="<?echo $MyPhoto;?>">

