Switch to English?
Yes
Переключитись на українську?
Так
Переключиться на русскую?
Да
Przełączyć się na polską?
Tak
Post your project for free and start receiving proposals from freelancers within minutes after publication!

NodeJS when adding a record to MYSQL leaves a duplicate

Translated7 USD

Client's review of cooperation with Aleksey S.

Quality
Professionalism
Cost
Contactability
Deadlines

Excellent artist, did everything quickly and quality!

Freelancer's review of cooperation with Artem Kravchenko

Payment
Task setting
Clarity of requirements
Contactability

The customer is an adequate and pleasant person. It was pleasant to work. The only thing that was not quite clear was the task explained, but it was compensated by Arthom’s communication. Everyone is pleased and I advise for cooperation.

  1. 899    21  0   1
    Winning proposal1 day7 USD

    Good time of day.
    I am a full stack web developer, I have been working on node.js for more than 3 years.
    Ready to fulfill your order.
    Write, we will discuss the details, and I will begin the work.
    With respect, Alexey

  • Aleksey Golovin
    10 April 2021, 11:48 |

    1. Попробуйте поменять метод генерации случайных чисел. 

    2. Добавьте проверку наличия записи перед добавлением ее в базу данных и запускайте генерацию повторно если запись существует.

  • Artem Kravchenko
    10 April 2021, 11:51 |

    метод к сожалению менять не вариант 😔

    а по поводу проверки, в nodejs и mysql в прямых запросах не разбираюсь, вот в php - другое дело)


    поэтому и разместил заявку

  • Profile deleted
    10 April 2021, 11:55 |

    вопрос непонятный, если хотите чтобы поля были индентити то просто сделайте их PK хоть это и херня)

  • Artem Kravchenko
    10 April 2021, 11:59 |

    что такое рк?))

    вот пример, я запускаю приложение на 2 значения, и получаю в базу данные:

    id       hash      multiplier

    1        123       1.00

    2        456       8.00


    потом запускаю еще раз приложение, получаю в базу данные:

    id       hash      multiplier

    3        123       1.00

    4        456       8.00


    т.е айди auto incriment и меняется, а данные начинаются вписываться сначала, то что сначала - это нормально, вот нужно дубли не добавлять

  • Aleksey Golovin
    10 April 2021, 12:15 |

    SELECT id FROM mytable WHERE hash=xxx AND multiplier=yyy

    Если запрос вернул записи, то надо повторно генерировать данные. 


    Почитай про псевдослучайные числа. должен быть метод который генерацию случайных чисел делает более случайными. Например в С++ я использую вот такие функции 

    srand(time(NULL));

    randomize();

  • Profile deleted
    10 April 2021, 12:00 |

    сделай hash первичным ключем

  • Artem Kravchenko
    10 April 2021, 12:03 |

    сделал это еще сначала image


  • Profile deleted
    10 April 2021, 12:10 |

    ошибка если будет в трай кеч заверни

  • Aleksey Golovin
    10 April 2021, 12:07 |

    Это приведёт к ошибке. А ее надо будет обрабатывать.

Current freelance projects in the category Databases & SQL

Development of the web service "Interactive Veterinary Dental Map"

Project essence: a web application where doctors can maintain interactive dental charts for patients (cats and dogs) The interface design and all jaw elements are already fully prepared in Figma (vector SVG with separation by individual teeth) Required functionality:…

Databases & SQLWeb Programming ∙ 2 hours 15 minutes back ∙ 31 proposals

Eliminate the issue of incomplete data import from Excel files of Nova Poshta specifications into 1C:

45 USD

Goal: There is a processing in 1C for uploading the specifications of Nova Poshta. For unclear reasons, it has stopped loading some tabular data. We need to find the reason and eliminate the problem of incomplete data import from Excel files of Nova Poshta specifications into…

System & Network AdministrationDatabases & SQL ∙ 4 hours 17 minutes back ∙ 9 proposals

Accounting, planning, and sales system for a mushroom farm

601 USD

Here is the complete, final text of the Technical Assignment (TA). It combines all your requirements: 16 chambers, 20 contractors, a schedule by days, accounting for containers, profitability calculation, and a mandatory division into three grades of mushrooms. You can fully…

Databases & SQLClient Management & CRM ∙ 2 days 8 hours back ∙ 54 proposals

External report 1C 8.3 — forecast of goods balances

22 USD

An external report (.erf) is needed for 1C:Enterprise 8.3 (configuration to be specified). What it should do: Extract product balances from the database Analyze sales history for the last 30 days Calculate the average sales rate for each product Determine how many days until the…

Databases & SQLClient Management & CRM ∙ 2 days 8 hours back ∙ 13 proposals

Web Application & Database Security Audit for Custom CRM — BaaS / Database-as-API Specialist (Penetr

Project Overview We operate a custom-built customer relationship management (CRM) platform that runs two service businesses on a single system. It is a modern JavaScript web application backed by a backend-as-a-service (BaaS) database and deployed on a serverless hosting…

Databases & SQLTesting & QA ∙ 2 days 21 hours back ∙ 10 proposals

Client
Artem Kravchenko
Ukraine Ukraine  14  0
Project published
5 years back
34 views