I have two tables where the two id's are exactly the same. Both ids are auto incremented.
There are table users and table players.
table users contains:
id
username
password
player_id
and some more stuff irrevelent to the problem.
table players contains
player_id
player_name
and some more stuff irrevelent to the problem
What I am trying to do is insert into both tables so that the player_ids match. later on, I will be updating them by the player_ids.
Here are my statements. Note that $obj is just an sql class.
$sql = "INSERT INTO players VALUES ('', '$name[$z]', '0', 'N/A', 'N/A', 'Unknown', '$dkp_earnt[$z]', '0','0','0')";
$result = $obj->Query($sql);
$sql1 = "INSERT INTO users VALUES('', 'unregistered', 'none', 'N/A', 'N/A', LAST_INSERT_ID(), '$time', '0.0.0.0','0')";
$result1 = $obj->Query($sql1);
I know this is vague, but when these statement occurs I notice a large gap in the inserts. What I mean is this: Say I will have 1 to 50 ids, then the next insert I will have 75 to 100. I believe I have a bug in my script and it is inserting null items. Is this possible? What can php cause large gaps like that.