Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'connection.php';
- $image = $_FILES['image']['name'];
- $thumb = $_FILES['thumb']['name'];
- $prop_id = $_POST['item'];
- $resize = new Imagick($thumb);
- $resize->adaptiveResizeImage(150,150);
- //echo $image;
- $imagePath='uploads/'.$image;
- move_uploaded_file($_FILES['image']['tmp_name'],$imagePath);
- $thumbPath='uploads/'.$resize;
- move_uploaded_file($_FILES['thumb']['tmp_name'],$thumbPath);
- // Check Queries if Duplicate
- $res = $connect->query("SELECT * FROM properties WHERE category_id = '".$prop_id."' AND image = '".$image."' ");
- $check=mysqli_num_rows($res);
- if($check>0) :
- else :
- // Add if no Data duplicate
- $connect->query("INSERT INTO properties (category_id,image,thumb) VALUES ('".$prop_id."','".$image."','".$thumb."') ");
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement