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

The Archive Base Latest Questions

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

I was wondering if you can maybe help me out here… I created a

  • 0

I was wondering if you can maybe help me out here… I created a link sharing website and managed to create a comment on a shared link.

I want to give you a scenario of what I would like to achieve. Every comment made by user_1 for instance, can only be deleted by user_1 and admin.

I understand that when “deleting” it from the php page it must also be dropped from the database. How can you do this?

//I pressume where I INSERTED my post's 'vales' I must DELETE them again from there??
//It is very much alike from reply.php's code where you INSERT the data into the database. Now I just want to delete it.
//I don't know if this code below is correct??

$sql = "DELETE FROM 
            posts(post_content,
                  post_date,
                  post_topic,
                  post_by) 
        WHERE ('" . $_POST['reply-content'] . "',
                NOW(),
                " . mysql_real_escape_string($_GET['id']) . ",
                " . $_SESSION['user_id'] . ")";


$result = mysql_query($sql);

if(!$result)
{
    echo 'Your reply has not been saved, please try again later.';
}
else
{
    echo 'Your comment has been deleted!';
}
  • 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-26T03:28:53+00:00Added an answer on May 26, 2026 at 3:28 am

    Your Delete query has major syntax errors. You don’t delete individual fields from a table – you CAN’T. you can only delete entire records. The proper syntax is:

    DELETE FROM sometable WHERE (...)
    

    Your where clause also has errors. You’re not doing any comparison operations, just listing some values. Again, a syntax error. Most like you’d want this (guessing at your post’s table primary key field name):

    DELETE FROM posts WHERE (post_id = $id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering if anyone can help me out with parsing out data for
was wondering how can I create a sub drop down box upon selecting a
I was wondering how can I do something similar to Facebook when a link
I was wondering how can I track the current logged in user in a
I was wondering how can I control the image on the connect dialog? I
i'm wondering how can I compare in C language, a number I put on
I was wondering how can we can use the python module networkX to implement
I was wondering how can I generate the following array using ranges in ruby
I was wondering how can I list the user tables name with its primary
I am wondering how can I hide/remove a tag after a certain amount of

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.