I have several forms on my site. When the form submits we insert the lead into a database as well as send an email to several people. To ensure leads are not getting lost in either process I am attaching an ID($tracker) to each lead submission. The ID is pulled from an XML file that increments +1 on each submission.
The issue I am having is the increments are skipping numbers. The list of tracker IDs that I have is 1,6,8,9,10,19,22,23,41,48,50,59,66,68,69,74,79,82. I DO NOT have more emails than database submissions or visa versa. Any suggestions as to why my XML increment may be skipping numbers.
Here is my XML file.
<note>
<data>82</data>
<add>1</add>
</note>
Here is my code that increments the data # on submission.
$xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT'] . '/includes/catch.xml');
$xml->data = $xml->add + $xml->data;
$tracker = $xml->data;
Thanks in advance for any help!
The issue I was having was unrelated to the actually script that increments in XML. It had to do with the mySQL insert function failing. The XML would continue to increment even if the database insert failed leading to skipped numbers. I now have a catch in place for this.