Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/08/2021 in all areas

  1. I suspect your notification insert may be failing with an "unknown column" error. (You appear to have a space added in one of the column names) Implement database error checking. I also suspect that the concept of data normalization is completely foreign to you. You currenty have +-------------------+ +-------------------+ +-----------------------+ | order_price | | ordered_items | | notifications | +-------------------+ +-------------------+ +-----------------------+ | id |-------+ | id | | id | | order_id | +------| order_id |------+ | notification_title | +-------------------+ | user_id | | | cn_notification_title | | seller_id | | | m_notification_title | | product_name | | | notification_date | | quantity | | | notification_text | | purchase_price | | | cn_notification_text | +-------------------+ | | m_notification_text | | | user_id | | | seller_id | +-------| order_id | | product_id | | user_notify | | seller_notify | | admin_notify | +-----------------------+ Basically Data should be stored in one place only (with exception of ids which are used for the relational joins) Derived data should not be stored Your notifications table, with the exception of the date and final three (repeated) columns is either duplicated or derived. I would suggest the following model +-------------------+ +-------------------+ +----------------+ | order | | order_item | | product | +-------------------+ +-------------------+ +----------------+ | order_id |------+ | id | +-------| product_id | | user_id | +------<| order_id | | | product_name | | order_date | | | product_id |>-----+ | seller_id | +-------------------+ | | quantity | | purchase_price | | +-------------------+ +----------------+ | | | +-------------------+ +-----------------------+ | | notification_log | | notification_title | | +-------------------+ +-----------------------+ | | | | id | | | id | +------| who_notified | |------<| order_id | | | notification_title | | who_notified |>------+ +-----------------------+ | date_notified | +-------------------+ Also, you should be using prepared statements for those inserts instead of putting data values directly into the queries. Consider using transactions when inserting multiple records at one time.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.