Does this look right?
$Company = "INSERT INTO Company (company, address) VALUES ('$company', '$address')";
$CompanyResult = mysql_query($Company) or die(mysql_error());
$compId = mysql_insert_id();
$User = "INSERT INTO Users (name) VALUES ('$user')";
$UserResult = mysql_query($User) or die(mysql_error());
$userId = mysql_insert_id();
$Company = "INSERT INTO Company (company, address) VALUES ('$company', '$address')";
$CompanyResult = mysql_query($Company) or die(mysql_error());
$compId = mysql_insert_id();
$URL = "INSERT INTO Urls (url) VALUES ('$url')";
$URLResult = mysql_query($URL) or die(mysql_error());
$urlId = mysql_insert_id();
$CompSQL = "INSERT INTO Company (compId) VALUES ($compId)";
$InsertResult = mysql_query($CompSQL) or die(mysql_error());
$UserSQL = "INSERT INTO User (userId, compId) VALUES (userId, $compid";
$InsertResult = mysql_query($UserSQL) or die(mysql_error());
$CompSQL = "INSERT INTO Company (compId) VALUES ($compId)";
$InsertResult = mysql_query($CompSQL) or die(mysql_error());
$UrlsSQL = "INSERT INTO Urls (urlId, userId) VALUES ($urlId, $userId)";
$InsertResult = mysql_query($UrlsSQL) or die(mysql_error());