本文整理汇总了PHP中person::get_state方法的典型用法代码示例。如果您正苦于以下问题:PHP person::get_state方法的具体用法?PHP person::get_state怎么用?PHP person::get_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类person
的用法示例。
在下文中一共展示了person::get_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_person
function add_person(person $person)
{
connect();
$result = mysql_query("SELECT * FROM PERSON WHERE ID = '" . $person->get_ID() . "'");
if (!$result) {
error_log('ERROR on select in add_person() ' . mysql_error());
die('Invalid query: ' . mysql_error());
}
// the function get_MS_ID does not exist in the original Homebase code
// this code causes and error and should be deleted
// not clear what the logic was
/* if (mysql_num_rows($result) != 0)
{
delete_dbMasterSchedule($person->get_MS_ID());
connect();
} */
error_log('will insert person id= ' . $person->get_id() . ' avail= ' . $person->get_availability());
$avail = implode(",", $person->get_availability());
$schedule = implode(",", $person->get_schedule());
$query = "INSERT INTO PERSON VALUES ('" . $person->get_id() . "','" . $person->get_first_name() . "','" . $person->get_last_name() . "','" . $person->get_birthday() . "','" . $person->get_gender() . "','" . $person->get_address() . "','" . $person->get_city() . "','" . $person->get_state() . "','" . $person->get_zip() . "','" . $person->get_phone1() . "','" . $person->get_phone2() . "','" . $person->get_email() . "','" . $person->get_type() . "','" . $person->get_status() . "','" . $schedule . "','" . $person->get_notes() . "','" . $person->get_skills() . "','" . $person->get_reason_interested() . "','" . $person->get_date_added() . "','" . $person->get_password() . "','" . $avail . "','" . $person->get_contact_preference() . "');";
error_log('query is ' . $query);
$result = mysql_query($query);
if (!$result) {
error_log("error doing insert in add_person " . mysql_error());
echo mysql_error() . " - Unable to insert in PERSON: " . $person->get_ID() . "\n";
mysql_close();
return false;
}
mysql_close();
return true;
}