Ok, first off I'd direct my form to a page of my own, say "submit.php", which would store the data passed to it into the database and then (before echoing any data to the page) use header() to redirect the user to the api url.
I'm assuming you know ho to connect to a database and submit the data. If now, search the web for a tutorial, there's millions.
Use
<form action="submit.php" method="post">... to submit the username to submit.php, whose code is below:
<?php
//send the info to this page via POST method.
$username = $_POST['username'];
//connect to database a run sql "INSERT INTO" query.
$loc = 'location: www.apidomain.com?username=' . $username;
header($loc);
//that last line redirects the user to the api site submitting the username.
?>
Alternatively, you could embed the apidomain.com in a frame or something like that to keep the user on your page, or add "&return=www.yourdomain.com/done.php" to $loc and configure the api to return the user to the value specified.
With the auto increment thing, what is it that you want to auto increment? The id, in the table, of the username submitted? If so, set up a column to auto increment when you create the SQL table.
(If none of this is making sense then look at some tutorials for forms, MySQl tables etc. with this stuff in mind)
Hope that helped.