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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:38:30+00:00 2026-06-07T04:38:30+00:00

So i have this two tables, the operators_payments AS op is populated with data,

  • 0

So i have this two tables, the operators_payments AS op is populated with data, but the op.date_paid will be NULL, till payment date arrives, when this happens, the payment_process AS pp table is used to initialize the payment (pp.date_started is set to NOW()), then for payment completion the op.date_paid is set to pp.date_started. The shown query, is used to do this, all is good, but when all records are updated, one of the records and only one gets the op.date_paid with different time, specifically the second part e.g.(time set to all but one: 2012-07-05 17:28:14, time set to one: 2012-07-05 17:28:02).

Im using Mysql 5.5, the columns have the same type (TIMESTAMP).
I need this because i need the date to be exact as the one in pp.date_started.

My question is, Why does this happens, and what can i do to have this as espected?

UPDATE operators_payments AS op
    JOIN payment_process AS pp
        ON op.operator_id = pp.operator_id
        AND pp.type = 0
        AND pp.status = 1
SET op.date_paid = pp.date_started, pp.status = 2, pp.message=CONCAT(SUBSTRING_INDEX(message, '|', 1), '| was completed successfully!')
    WHERE op.operator_id = {$this->operator_id}
        AND op.date_paid IS NULL
        AND op.date_end <= pp.date_accounted


+---------------+-----------------------+------+-----+-------------------+----------------+
| Field         | Type                  | Null | Key | Default           | Extra          |
+---------------+-----------------------+------+-----+-------------------+----------------+
| payment       | int(10) unsigned      | NO   | PRI | NULL              | auto_increment |
| operator_id   | int(10) unsigned      | NO   | MUL | 0                 |                |
| date_paid     | timestamp             | YES  | MUL | NULL              |                |
| date_start    | timestamp             | YES  |     | NULL              |                |
| date_end      | timestamp             | YES  | MUL | NULL              |                |
| amount        | decimal(6,4) unsigned | NO   |     | 0.0000            |                |
+---------------+-----------------------+------+-----+-------------------+----------------+


+----------------+--------------+------+-----+-------------------+-----------------------------+
| Field          | Type         | Null | Key | Default           | Extra                          |
+----------------+--------------+------+-----+-------------------+-----------------------------+
| operator_id    | int(11)      | NO   | PRI | NULL              |                             |
| type           | tinyint(4)   | NO   | PRI | NULL              |                             |
| date_started   | timestamp    | YES  |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| date_accounted | timestamp    | YES  |     | NULL              |                             |
| amount         | decimal(6,4) | YES  |     | NULL              |                             |
| status         | tinyint(4)   | YES  | MUL | 0                 |                             |
| message        | varchar(255) | YES  |     | NULL              |                             |
+----------------+--------------+------+-----+-------------------+-----------------------------+
  • 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-07T04:38:32+00:00Added an answer on June 7, 2026 at 4:38 am

    I have a suspicious eye toward that on update CURRENT TIMESTAMP clause on the date_started on payment_process… I’m not actually sure what it could be doing in this query, but you are updating that table in this query, and using that value. I also don’t like the semantic discord of a column called date_started which has it’s value changed on every update… but I don’t know how it’s used. I would evaluate if that clause is necessary on that column, and see if you get this strange behavior without it,

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

Sidebar

Related Questions

I have this two tables: Table A ID TYPE SDATE EDATE RATING 1 M
I have this two tables from my program to manage stock: Articulos (items): id_articulo
I have two tables: This is table1: product_id|product_desc|product_name|product_s_desc This is table2: product_price_id|product_id|product_price Now I
I have two tables which looks something like this Table Queue int ID; string
I have two tables like of this structure: content (content_id, content_type, user_id, time, comment_count)
I have two tables associated by FK. Table student is mapped like this: @Entity
I have two tables Department and Employee . Department table looks like this: ID
Let's say I have two tables that look like this: TH TH TH TH
So I have two tables students (PK sID) and mentors (PK pID). This query
This is SQL Server 2008. I have these two tables and a join: DECLARE

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.