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

  • Home
  • SEARCH
  • 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 9131891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:13:05+00:00 2026-06-17T08:13:05+00:00

Basically, from the form that I made I send customer_name and with this code

  • 0

Basically, from the form that I made I send customer_name and with this code I pull it and save it to the database along with the time. This code keeps giving me this error:

Fatal error: Using $this when not in object context in /home/projectu/public_html/sub/save.php on line 19

Note: 19th line is this one:

$db->query($queryone);

Here is my code:

Whole Save.php

include('db-config.php');

$customer_name = $_POST['customername'];

/* Kaspersky */
$kaspersky_date = strtotime("+11 months").'|'.strtotime("+12 months");
$kaspersky = explode("|", $kaspersky_date);
$kaspersky_temp = "$customer_name got new kaspersky.";

/* PC Picked-UP */
$pickedups_date = strtotime("+1 months");
$pickedups_temp = "$customer_name picked up his computer.";


if(isset($_POST['kaspersky'])) {
$queryone = "INSERT INTO sublist (scheduled_date, customer_name, kaspersky_status, kaspersky_template)
                       VALUES ($kaspersky[0], $customer_name, YES, $kaspersky_temp)";

$this->query($queryone);

$querytwo = "INSERT INTO sublist (scheduled_date, customer_name, kaspersky_status, kaspersky_template)
                       VALUES ($kaspersky[1], $customer_name, YES, $kaspersky_temp)";

$this->query($querytwo);

}
if(isset($_POST['pickeduppc'])) {
$query = "INSERT INTO sublist (scheduled_date, customer_name, pcpickup_status, pcpickup_template)
                       VALUES ($pickedups_date, $customer_name, YES, $pickedups_temp)";
}
  • 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-17T08:13:06+00:00Added an answer on June 17, 2026 at 8:13 am

    You cannot use $this in a non object or static method. You should create a new object.

    $db = new mysqli(......);
    $db->query("SELECT ... FROM...");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem getting this code to work. Basically I Go from
Basically I pull an Id from table1, use that id to find a site
I have a main class(which is basically a netbeans form;drag and drop) from where
Basically from C++ FAQ I learned that: A virtual function allows derived classes to
I've got a program made basically from a ListCtrl and has an add button,
I've got a conversion utility that basically copies values from one table to another.
I'm making a Android app that basically plays video from a website on the
Can I have some help in improving this linq. I'm basically returning speakers from
I have a Windows form that's generated using code (including buttons and what not).
Basically, I have made a function that selects a certain image to display depending

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.