Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:10:20+00:00 2026-06-14T07:10:20+00:00

it must be said that I download the database and all my function is

  • 0

it must be said that I download the database and all my function is in class.

That’s how I was incredible pleased function and think they are nice ..

That’s how I’m going to build a gallery where the id of the upload to the site if it fits with the id_session is log in page, you have the option to delete it. and so it must just go back to / latest pictures / when it delete it from the folder and database. but it comes up with an error as you can see here;

Fatal error: Call to a member function bind_param () on a non-object in / home / jesperbo / public_html / mebe.dk / function / function.php on line 411

It is such that I am also in the process of building an upload system where the underlying database and make it smaller after what I have now set it and when it did the 2 things must send me back to / latest-images / but it do not reach the only available picture up on the server and do it with the picture but it will not go back in some way at all. So to / latest-images /

Where wrong with it to delete, etc. I lie just here,

$stm1->bind_param('i', $id_gallery);

function img_slet_indhold(){
        if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2)
        {
            if($stmt = $this->mysqli->prepare('SELECT `title` FROM `gallery` WHERE `id_gallery` = ?'))
            {
                $stm1->bind_param('i', $id_gallery);
                $id_gallery = $_GET["id_gallery"];

                $stm1->execute();
                $stm1->store_result();
                $stm1->bind_result($title);

                $UploadDir = "/gallery/";
                //ligger i toppen af documentet, evt som en define

                if($stm1->fetch())
                {
                    $tmpfile = $UploadDir . "" . $title;
                    if(file_exists($tmpfile))
                    {
                        unlink($tmpfile);
                    }
                    $tmpfile = $UploadDir . "lille/" . $title;
                    if(file_exists($tmpfile))
                    {
                        unlink($tmpfile);
                    }
                    $tmpfile = $UploadDir . "store/" . $title;
                    if(file_exists($tmpfile))
                    {
                        unlink($tmpfile);
                    }
                }
                $stm1->close();
            }
            else
            {
                /* Der er opstået en fejl */
                echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
            }
        }


        if($stmt = $this->mysqli->prepare('DELETE FROM `gallery` WHERE `id_gallery` = ?' ))
        {
            $stmt->bind_param('i', $id);
            $id = $_GET["id_gallery"];

            $stmt->execute();

            header('Location: /nyeste-billeder/');

            $stmt->close();

        }
        else
        {
            /* Der er opstået en fejl */
            echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
        }
    }

So into the file as it should delete from, I have chosen to do so here;

<?php 
session_start();
require_once ("function/function.php");
$mebe = new mebe;
$db = $mebe->db_c();
error_reporting(E_ERROR);

$img_slet_indhold = $mebe->img_slet_indhold();

?>

So when I upload image to folder and database, and just after can be returned when uploading

function img_indhold(){
        if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2)
        {
            include "function/class.upload.php";
            $handle = new Upload($_FILES["filename"]);

            if($handle->uploaded)
            {
                //lidt mere store billeder
                $handle->image_resize = true;
                $handle->image_ratio_y = true;
                $handle->image_x = 220;
                $handle->Process("gallery/store");

                //til profil billede lign..
                $handle->image_resize = true;
                $handle->image_ratio_crop = true;
                $handle->image_y = 115;
                $handle->image_x = 100;
                $handle->Process("gallery");

                //til profil billede lign..
                $handle->image_resize = true;
                $handle->image_ratio_crop = true;
                $handle->image_y = 75;
                $handle->image_x = 75;
                $handle->Process("gallery/lille");
                $pb = $handle->file_dst_name;

            }
            if($stmt = $this->mysqli->prepare('INSERT INTO `gallery` (`title`, `id_bruger`) VALUES (?, ?)'))
            {

                $stmt->bind_param('si', $title, $id_bruger);
                $title = $pb;
                $id_bruger = $_SESSION["id"];

                $stmt->execute();

                header('Location: /nyeste-billeder/');

                $stmt->close();


            }
        }
     }

So when I call it on the page when it is required to do so do it like this;

<?php 
session_start();
require_once ("function/function.php");
$mebe = new mebe;
$db = $mebe->db_c();
error_reporting(E_ERROR);

$img_slet_indhold = $mebe->img_slet_indhold();

?>

it is here as to when I will upload to the site and show gallery / pictures on the page

function vise_img(){
        if ($stmt = $this->mysqli->prepare('SELECT `id_gallery`, `title`, `id_bruger` FROM `gallery` ORDER BY `gallery`.`id_gallery` DESC')) { 
            $stmt->execute();
            $stmt->store_result();
            $stmt->bind_result($id_gallery, $title, $id_bruger);

            while ($stmt->fetch()) {
                echo "<div id=\"gallery_box\">";
                echo "<a href=\"/profil/$id_bruger/\"><img src=\"/gallery/$title\" alt=\"\" height=\"115\" width=\"100\" border=\"0\"></a>";
                if($_SESSION["logged_in"])
                {
                    if($id_bruger == $_SESSION["id"])
                    {
                        echo "<ul>";
                        echo "<li><a href=\"/nyeste-billeder-slet/$id_gallery/\">Slet</a></li>";
                        echo "</ul>";
                    }
                }
                echo "</div>";
            }

            /* Luk statement */
            $stmt->close();

        } else {
            /* Der er opstået en fejl */
            echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
        }
    }




   function upload_img(){
        if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2)
        {           
        ?>
        <form name="opslag" method="post" action="/nyeste-ok/" enctype="multipart/form-data">
            <input type="file" name="filename" id="filename" onchange="checkFileExt(this)">        
            <input name="upload" value="Upload" id="background_indhold" onclick="return check()" type="submit">
        </form>
        <?php
        }
        elseif ($_SESSION["logged_in"] != true && $_SESSION["rank"] != '1' || $_SESSION["rank"] != 2)
        {
            echo "<p>Du har ingen mulighed for at upload billeder på siden</p>";
        }

    }

Really hope you are able to help me further!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:10:24+00:00Added an answer on June 14, 2026 at 7:10 am

    I had a hard time understanding your question (I understand English is not your first language), so I am going based on the error message you included. In the first function img_slet_indhold() your variable is called $stmt in the if statement, but you are then referring to it as $stm1; this appears to be the cause of your error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is said that the web servers' clocks must be identical for the Expires
In the following, it is said that an I/O handle must be associated with
It is said that arrays are allocated at compile time, then the size must
In the context of DDD, it's always said that a Repository must only query
In The Haskell 98 Report it's said that A floating literal must contain digits
I was reading a job listing that said: MUST have prior experience on large
It is said that when input parameter is null, compareTo() should throw a NullPointerException.
What is the complexity of the below program? I think it must be O(n),
Scott said on Effective C++, 3rd Edition, pg. 43 that to make an abstract
when I push my code of etherpad, it said that [31m[2012-11-03 15:14:00.102] [ERROR] console

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.