Hell,,
I am trying to send images to he databse but not getting any response the images are not sending in the database can any one help me out
function add_watch() {
global $connection;
$prodimg= $_FILES["prodimg"]['name'];
$prodtype=$_FILES["prodimg"]['type'];
$prodtemp=$_FILES["prodimg"]['tmp_name'];
$target_path = 'Products/'.$prodimg;
$id = $_POST["u_id"];
$brand = $_POST["brand"];
$model = $_POST["model"];
$reff = $_POST["reff"];
$retail = $_POST["retail"];
$disc = $_POST["disc"];
$price = $_POST["price"];
echo $paper = $_POST["papers"];
$cmts = $_POST["cmts"];
$cond = $_POST["cond"];
$mtrl = $_POST["mtrl"];
$box = $_POST["box"];
echo $seller = $_POST["seller"];
$serial = $_POST["serial"];
move_uploaded_file($prodimg, $target_path);
$query = "insert into products(brand, u_id, model, reff, cmts, cond, mtrl, retail, disc, price, box, paper, serial, seller, image)";
$query .= " values('$brand', '$id', '$model', '$reff', '$cmts', '$cond', '$mtrl', '$retail', '$disc', '$price', '$box', '$paper', '$serial', $seller', '$prodtmp')";
if (isset($_POST["add"])) {
$query_confirm = mysqli_query($connection, $query);
header("Location:watch_search.php");
}
}
here is the form
<form method="post" action="add_watch.php?uid=<?php echo $_SESSION["uid"]; ?>">
<input type="hidden" name="u_id" value="<?php echo $_SESSION["uid"]; ?>" />
<div class="info">
<label>
<p class="info_staic">Brand</p>
<p class="info_dynamic"><input type="text" class="field" name="brand" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Model</p>
<p class="info_dynamic"><input type="text" class="field" name="model" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Ref.#</p>
<p class="info_dynamic"><input type="text" class="field" name="reff" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Retail Price</p>
<p class="info_dynamic"><input type="text" class="field" name="retail" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Disc</p>
<p class="info_dynamic"><input type="text" class="field" name="disc" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Price</p>
<p class="info_dynamic"><input type="text" class="field" name="price" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Seller</p>
<p class="info_dynamic"><input type="text" class="field" name="seller" required /></p>
<div class="clear"></div>
</label>
</div><!-- End of content left-->
<div class="info">
<label>
<p class="info_staic">CMTS</p>
<p class="info_dynamic"><input type="text" class="field" name="cmts" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Condition</p>
<p class="info_dynamic"><input type="text" class="field" name="cond" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Material</p>
<p class="info_dynamic"><input type="text" class="field" name="mtrl" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Box</p>
<p class="info_dynamic"><input type="text" class="field" name="box" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Papers</p>
<p class="info_dynamic"><input type="text" class="field" name="papers" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Serial</p>
<p class="info_dynamic"><input type="text" class="field" name="serial" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Papers</p>
<p class="info_dynamic"><input type="text" class="field" name="papers" required /></p>
<div class="clear"></div>
</label>
<label>
<p class="info_staic">Watch Image</p>
<p class="info_dynamic"><input type="file" class="field" name="prodimg" required /></p>
<div class="clear"></div>
</label>
<label>
<input type="submit" class="btn" value="Add New" name="add" style="margin:0;" />
<div class="clear"></div>
<label>
</div><!-- End of content right-->
</form>
<div class="clear"></div>
Thank You