This isn't exact code, but just a sketch of one way to do this. I cannot guarentee this is the most efficient way.
First of all, you should include a field that can identify the order in which the clients were added. Either an auto increment client_id field, or maybe the timestamp at creation.
Suppose you use client_id. To get the previously inserted sales_person_id, do something like this:
$result=mysql_query("SELECT sales_person_id FROM tablename ORDER BY timestamp DESC LIMIT 1");
$lastid=mysql_fetch_array($result[0]);
Then increment that id by this:
if($lastid==3) { $nextid=1; }
else { $nextid=$lastid+1; }
then use $nextid as the sales_person_id for the new client, and use
mysql_query("INSERT INTO tablename VALUES ( ..., $nextid, ...)");
This should get you started at least.