As to your original problem Matt;
How to insert X records, or rather new record stubs, into your db.
Running a loop X times to insert 1 record each time is one way - but very inefficient once it becomes 10 or 20 loops. You would really have to query for last insert id each time as well to account for simultaineous (can anyone spell that word 😕 ) users whose multiple insert queries would interleave the ids issued.
You could run a loop to build an insert query that inserted the X records in one go.
$base = "INSERT INTO table(username, phonenumber, listingnumber)
VALUES ($user,$phone,$list)";
$vals = "";
for($i=1;$i<$X;$i++) {
$vals .= ",($user, $phone, $list)";
}
$query = $base . $vals;
That will insert your X records in one go.