Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Delete data with the id from database
- if(isset($_POST['products_delete'])){
- $sql = "delete from products
- where
- id = ".@$_GET['id']."
- ";
- mysqli_query($db,$sql) or die(mysqli_error($db));
- header('location:'.$_SERVER['PHP_SELF']."?page=".@$_GET['page']);
- };
- };
- function product_details($db){
- $sql = "select * from products where id = .@$_GET['id']";
- $sqlQuery = mysqli_query($db,$sql) or die(mysqli_error($db));
- // header('location:'.$_SERVER['PHP_SELF']."?page=".@$_GET['page']);
- $intQuery = mysqli_num_rows($sqlQuery);
- if($intQuery == true){
- while($dbFetch = mysqli_fetch_array($sqlQuery)){
- if(!isset($dbFetch['img'])){
- $image = "image/no_image.png";
- }else{
- $image = $dbFetch['img'];
- }
- echo ' <div class="grid_10 content">
- <img class="grid_4 image "><img src="image/'.$image.'"/>
- <p class="name">'.$dbFetch['title'].'</p>
- <p class="text">'.$dbFetch['description'].'</p>
- <p class="fotograf">'.$dbFetch['creator'].'</p>
- <span class="pris">'.number_format($dbFetch['price'], 2, ',', '.').' DKK <a href="'.$_SERVER['PHP_SELF'].'?add_product='.$dbFetch['id'].'"><img src="image/icon/iconset/round_plus_icon&16.png" /></a></span><br />
- </div><a href="index.php"><div class=" grid_1 buy"></div></a>'
- ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment