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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:08:53+00:00 2026-06-11T06:08:53+00:00

Hello what i am trying to achieve is combining this line of code: This

  • 0

Hello what i am trying to achieve is combining this line of code: This is for my user Registrar

    if (isset($_POST['unenroll'])){
                $sql1="Update tbl_enroll SET status='unEnrolled'";
                    $unEn = mysql_query($sql1) or die (mysql_error());
                    }

To another code that will truncate ONLY the field in my database which is COUNT
So far this is what I am thinking:

      if (isset($_POST['unenroll'])){
                $sql1="Update tbl_enroll SET status='unEnrolled'";
                    $unEn = mysql_query($sql1) or die (mysql_error());
                $trunc="Delete count from tbl_enroll";
                    $restart = mysql_query($trunc) or die (mysql_error());
                    }

By the way the column i want to delete all data while maintaining the column is count am i doing this right? Cause i don’t wanna erase all data right now,Also is this coding structure correct? Why i am doing this is because i have an action in my system that would allow another type of user to update only 3 times so i want my registrar if a certain period is met the registrar would restart the count to begin again at 0. (With my basic knowledge I’m trying to learn mysql, don’t need to remind me about Mysqli or PDO i’ll get there when I’m better)

EDITED: please read again.
EDITED: My bad so truncate is a bad idea. I just want the column count in my database to erase/refresh the entire data but maintaining the column itself.

  • 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-11T06:08:54+00:00Added an answer on June 11, 2026 at 6:08 am

    Since you requested my comment in answer form, you can simply combine more update of columns after SET with an comma making your code:

     if (isset($_POST['unenroll']))
     {
         $sql1="Update tbl_enroll SET status='unEnrolled', count = 0";
         $unEn = mysql_query($sql1) or die (mysql_error());
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello im trying to echo only the 50 letters, but something in my code
Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
Hello fellow developers, I am trying to achieve something in Android and I would
I have this HTML code: <p>Hello <span class=hide style=display:none>there</span> jquery</p> <button class=toggle>Toggle</button> <p>Hello <span
First of all, hello. I've been trying to achieve something in quite a long
I'm trying to achieve PUB/SUB over IPC. If I changed the code below so
I am trying to achieve something like this in a server control. <MyNewControl runat=server>
I'm trying to let the user input commands at a console using raw_input(), this
I'm trying to achieve the following behaviour in html: user is presented with a
i am trying to display google map on Android refering to this tutorial http://developer.android.com/resources/tutorials/views/hello-mapview.html

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.