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 8238991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:59:34+00:00 2026-06-07T19:59:34+00:00

The error referenced in the title is occurring (apparently) on line 33. As a

  • 0

The error referenced in the title is occurring (apparently) on line 33. As a side note, if you have any recommendations on ways I could optimize this, or just general suggestions, I’m all ears. Thanks!

Here’s the code:

<?php
error_reporting(E_ALL);
require('config.php');

$filename = htmlentities($_FILES['file']['name']);
$tmpname = $_FILES['file']['tmp_name'];
$filesize = $_FILES['file']['size'];
$filetype = $_FILES['file']['type'];    
$file = $_FILES['file'];

class connect {

    public function dbConnect($host, $user, $pass, $dbname) {

        try {
            global $dbcon;
            $dbcon = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
        }
        catch (PDOException $e) {
            print $e->getMessage();
        }
    }
}

class upload Extends connect {
    public function uploadFile($dbcon, $filename, $filesize, $filetype, $file) {

        if ($filesize > 2000000) {
            echo "File too large!";
        }
        elseif ($filesize <= 2000000) {
            $stmt = $dbcon->prepare("INSERT INTO upload (name, type, size, content) VALUES (?, ?, ?, ?)");
            $stmt->$dbcon->bindParam(1, $filename);
            $stmt->$dbcon->bindParam(2, $filetype);
            $stmt->$dbcon->bindParam(3, $filesize);
            $stmt->$dbcon->bindParam(4, $file);
            $stmt->$dbcon->execute();
            $stmt->$dbcon->close();
            echo "File uploaded!";
        }
        else {
            echo "Unexpected error! Please try again!";
        }
    }
}
$con = new connect;
$con->dbConnect($host, $user, $pass, $dbname);

$exec = new upload;
$exec->uploadFile($dbcon, $filename, $filesize, $filetype, $file);
  • 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-07T19:59:35+00:00Added an answer on June 7, 2026 at 7:59 pm

    You should use:

    $stmt->bindParam();
    

    Drop $dbcon from $stmt->$dbcon->bindParam().

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

Sidebar

Related Questions

I have an error (shown in title) which occurs when I run this script:
I have the following error: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Am getting this error for my code: Undefined symbols for architecture x86_64: _spendDollars, referenced
I am getting the object reference error in this line: emp[count].emp_id = int.Parse(parts[0]); in
Giving an Error Object Expected Line 48 Char 1------What did I do wrong??? *****Note
I'm getting the error referenced in the title from a file that doesn't reference
Ey guys, I have been referencing this project, but I get this linker error:
I have a single user at a website who gets this error: Object reference
I am receiving an error at this line return folder.SubFolders.Aggregate(count, (current, subfolder) => GetFilesCount(subfolder,
I have been trying to implement the solution referenced at: Error when trying to

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.