【php开源代码栏目提醒】:网学会员在php开源代码频道为大家收集整理了getID.php提供大家参考,希望对大家有所帮助!
<?php
/*
* Created on 2006-11-21
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse -
PHP - Code Templates
*/
require_once('db.php');
function getProvinceID($province)
{
$db = new DataAccess();
$db->connect();
$sql = "select arealist_id from arealist where areaclass='$province'";
$result = $db->query($sql);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$provinceid = $row['arealist_id'];
return $provinceid;
}
function getJoblistID($jobtype)
{
$db = new DataAccess();
$db->connect();
$sql = "select joblist_id from joblist where jobclass='$jobtype'";
$result = $db->query($
sql);
$row =
mysql_fetch_array($result,MYSQL_ASSOC);
$jobtypeid = $row['joblist_id'];
return $jobtypeid;
}
function getSpecialistID($special)
{
$db = new DataAccess();
$db->connect();
$sql = "select speciallist_id from speciallist where specialname='$special'";
$result = $db->query($sql);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$specialid = $row['speciallist_id'];
return $specialid;
}
?>