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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:19:04+00:00 2026-05-23T05:19:04+00:00

I have a Problem with MySQL update. The code below is working but i

  • 0

I have a Problem with MySQL update. The code below is working but i want to block that others try to enter Data at Field “status” again.

How can i write the command for that?

if(isset($_GET['up']))
{
  if(strlen($_GET['up'])==71)
  {
    db_conn();
    $raw = explode(":",$_GET['up']);
    $sql = "UPDATE ".$database_table." SET status='".$raw[1]."',upl_time='".time()."' WHERE hash='".$raw[0]."' LIMIT 1";
    if(mysql_query($sql))
    {
    print "ACK";
    } 
    else
    print "NACK";

  }
  exit;
}
  • 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-23T05:19:05+00:00Added an answer on May 23, 2026 at 5:19 am

    There are a couple of ways to do so:

    1. Add a field – IS_UPDATED – to your table to maintain some sort of a flag that defaults to FALSE. Then in your query that updates the status field, also set IS_UPDATED to TRUE. Also, in the update query, add this condition to the where clause – IS_UPDATED = FALSE. This will mean that the status column will only update if it has not already been updated.

    2. If the field upl_time is originally NULL or empty, and is only updated in the above query, when the status column is updated, I think you can as well use this column instead of adding a new one. But this is better known by you.

    3. I’m not sure what’s the origin of the update query from your application. But if possible, you might also consider adding logic to your application to disable the UPDATE altogether.

    I’d prefer approach 1.

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

Sidebar

Related Questions

I have a mysql problem, my query looks as follows but not complete SELECT
I have a problem for querying records into mysql explanation below The user could
I have a simple entity, Code, that I need to persist to a MySQL
I have mysql error with code 1451. Cannot delete or update a parent row:
How to update table data with data stored in session? I have following code
I have a problem with integers in MySQL. I am trying to update a
I have a problem with my code. My objective is to fetch some data
I have a problem with MySQL and Python's MySQLdb when I try to INSERT
I have problem with creating a simple MySQL trigger in C#. I'm using StringBuilder
I have a problem with the MySQL root user in My MySQL setup, and

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.