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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:05:54+00:00 2026-05-28T03:05:54+00:00

This page will delete a post: require_once (‘db.php’); $db = new DB(); $db->deletePost($_GET[‘id’], $_GET[‘postType’]);

  • 0

This page will delete a post:

require_once ('db.php');
$db = new DB();
$db->deletePost($_GET['id'], $_GET['postType']);

db.php only contains a class which called DB and its functions.

this is a part of db.php:

public function deleteComment($post_id, $post_type)
{
    $query = "delete from t_comments where c_type = '$post_type' and c_id = '$post_id';";
    $this->execute($query);
}
public function deletePost($post_id, $post_type)
{
    deleteComment($post_id, $post_type);
    $query = "delete from t_news where n_id = '$post_id';";
    $this->execute($query);
}

Then mysql says:
Fatal error: Call to undefined function deletecomment() in db.php on line 70

I defined deleteComment above the deletePost!So what’s the problem?Can’t I call another function of a class in that class?But in C++, I think it is possible!

  • 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-05-28T03:05:55+00:00Added an answer on May 28, 2026 at 3:05 am

    Use this:

    $this->deleteComment($post_id, $post_type);
    

    instead of

    deleteComment($post_id, $post_type);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in this page http://api.jquery.com/category/effects/ when you put 'up'(keyboard) and 'down',then put 'enter',it will go
i have this page . login: fer password: m Note: after login you will
$string = This is my page content. This text will be paginated.; $pageNo =
The T-SQL MSDN page states The timestamp syntax is deprecated. This feature will be
I'm trying to get an HttpRequest to post this URL https://www.iformbuilder.com/exzact/_emptyTable.php?PAGE_ID=1234&TABLE_NAME=table_name_here&USERNAME=yo@yo.com&PASSWORD=What!What ! I've tried
I have this html form echo <form name='delete_article_form.$row['id'].' action='sources/public/article_processor.php' method='POST' >; echo <input name='processor_switcher'
This page from Adobe says to add a wmode parameter and set its value
This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle. How would
This page displays beautifully in firefox but i get all kinds of problems when
This page in the Android documentation defines an element id as follows: <TextView android:id=@+id/label

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.