<? 
require_once "include/application.php"; 
require_once "include/function.php";
/*
	$sql="select c_id,c_name from company where c_user='eric'";
	$result=mysql_query($sql);	
	while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
	{

	echo	$sql2="update `person` set p_company='".$myrow["c_id"]."' where  p_user='eric' and p_joinbuyer3='".$myrow["c_name"]."'";	
		@mysql_query($sql2) or die(mysql_error());
	
	}
*/
	$sql="select p_id,p_joinbuyer3 from person where p_user='eric' and p_joinbuyer3<>''";
	$result=mysql_query($sql);	
	while($myrow=MySQL_fetch_array($result,MYSQL_ASSOC))
	{

	echo	$sql2="update `company` set c_person='".$myrow["p_id"]."' where c_user='eric' and c_name='".$myrow["p_joinbuyer3"]."'";	
		@mysql_query($sql2) or die(mysql_error());
	
	}

?>