MYSQL_CONNECT('db01.ruffnet.local','c436leguan','iczblwyi'); mysql_select_db("c436leguan"); include('../common.php'); function getMax($tablename){ $query = "select max(id) from ".$tablename; $result = mysql_query($query); $maxid = mysql_fetch_row($result); return $maxid[0]+1; } if ($param=='insert'){ $da = date('Ymd'); $maxemail = getMax("hiremail"); $query = "insert into hiremail values (".$maxemail.",'".$email."','".$da."')"; $result = mysql_query($query); if ($tek!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','tek')"; $result = mysql_query($query); } if ($gyi!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','gyi')"; $result = mysql_query($query); } if ($kig!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','kig')"; $result = mysql_query($query); } if ($akv!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','akv')"; $result = mysql_query($query); } if ($ize!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','ize')"; $result = mysql_query($query); } if ($eml!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','eml')"; $result = mysql_query($query); } if ($ket!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','ket')"; $result = mysql_query($query); } if ($kel!=''){ $query = "insert into hirkapcs values (".getMax("hirkapcs").",'".$maxemail."','kel')"; $result = mysql_query($query); } } ?>