Jump to content

ranger2022

New Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by ranger2022

  1. 12 hours ago, requinix said:

    Not being able to share any code is going to be a problem. Surely you can post a few lines from some select locations?

    The most likely culprit is an improper SQL statement that let the data somehow corrupt the query, causing it to fail. For example, if it contains apostrophes and quotation marks.

    Knowing what data is not being inserted would be nice so that you could look for a pattern in what does and doesn't work.

    I was approved to share some code! Here is where it looks like data is inserted into the database.

    image.png.68e5f047450f8b4fea2004571e818a32.png

     

  2. 1 hour ago, mac_gyver said:

    when data insertion fails occasionally, it's usually because of sql special characters in a value breaking the sql query syntax, data containing duplicate values that violate a unique index or other constraint, or data that is out of range for a column definition. these conditions would produce query errors, so, the question becomes does the php code have error handling for all the database statements that can fail - connection, query, prepare, and execute that would be logging the errors to the php error log or is the mysql general query log enabled (it's not by default)?

     

    I'll look for that, based on what I've worked on so far this definitely seems like a possibility. Thank you!

  3. 1 hour ago, requinix said:

    Not being able to share any code is going to be a problem. Surely you can post a few lines from some select locations?

    The most likely culprit is an improper SQL statement that let the data somehow corrupt the query, causing it to fail. For example, if it contains apostrophes and quotation marks.

    Knowing what data is not being inserted would be nice so that you could look for a pattern in what does and doesn't work.

    I will have to check if I am allowed to share any and I'll post as soon as I know. Thank you!

  4. Hello,

    Here's my problem, I have a device that sends a post request to a php endpoint. The php code takes that data and puts it into a MySQL database, but the data does not always end up in the database. I have about 100 of these devices posting to this endpoint running on a server in plesk. For a majority of devices, the code seems to work fine the vast majority of the time. Some devices however have much of they're data missing. It is very important that all of the data the device successfully sends out is recorded in the database. I've verified that this is not a device issue i.e. a post request is made and a 200 OK response is received but even then the data doesn't show up in the database so I've narrowed down the search to the issue being between the data base and the php code that sends the data to the database, and that is where I'm stuck.

    I'm new to this system and am unfortunately unfamiliar with php and MySQL databases. Nonetheless I've been tasked with fixing this issue. Unfortunately I don't think I can share any of the php code so I'm really just reaching out into the void here. But has anyone ever dealt with an issue like this? If you can give me literally any information or things to look for I would really appreciate it. I'm learning php and MySQL while I'm trying to fix this issue so my knowledge is very limited.

    Please help me lol Thanks.

×
×
  • 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.