Forgive me if this is posted in wrong forum.
I am using xampp with mysql.
I have been reading that it is poor practice to insert image files directly into data base and the best practice is to access them form other source.
I have created a table in mysql with column called pics. the primary key is id and it is auto increment.
My goal is to assign a different image file to each row in the pic column and display using mysql query.
would I use some kind of fopen and _POST syntax
or <img src = and display in a html element?
Also do the image files have to be stored in htdocs folder or can they be accessed form anywhere on C:\\
After searching the topic on internet I haven't found an answer that I understand.
I really have no clue.
Here is the code I am working with so far.
require 'connect_inc.php.';
$query = "SELECT `manuf`, `model_name`, `pics` FROM `compound` ORDER BY `id`";
if ($query_run = mysql_query ($query)){
echo 'Query success<br>';
while ($query_row = mysql_fetch_assoc ($query_run)) {
$manuf = $query_row ['manuf'];
$model_name = $query_row ['model_name'];
$pics = $query_row ['pics'];
echo '<strong>Make:</strong>'. ' '. '<strong>Model:</strong>'.'<br>' . $manuf.' '. ' '.$model_name.$pics.'<br>';
}
} else{
echo mysql_error().'<strong><font color = "red">Query failed!</font></strong>';
}