本文整理汇总了PHP中person::set_value方法的典型用法代码示例。如果您正苦于以下问题:PHP person::set_value方法的具体用法?PHP person::set_value怎么用?PHP person::set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类person
的用法示例。
在下文中一共展示了person::set_value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
$query .= prepare(" AND skillID = %d", $_POST["skillID"][$i]);
$db->query($query);
if (!$db->next_record()) {
$proficiency->save();
}
}
}
}
}
}
}
if ($_POST["save"]) {
$person->read_globals();
if ($person->can_write_field("perms")) {
$_POST["perm_select"] or $_POST["perm_select"] = array();
$person->set_value("perms", implode(",", $_POST["perm_select"]));
}
if ($_POST["password1"] && $_POST["password1"] == $_POST["password2"]) {
$person->set_value('password', encrypt_password($_POST["password1"]));
} else {
if (!$_POST["password1"] && $personID) {
// nothing required here, just don't update the password field
} else {
alloc_error("Please re-type the passwords");
}
}
if ($_POST["username"]) {
$q = prepare("SELECT personID FROM person WHERE username = '%s'", $_POST["username"]);
$db = new db_alloc();
$db->query($q);
$num_rows = $db->num_rows();
示例2: while
Surname,
Password,
E-mail,
Phone No,
Comments
*/
$cur = config::get_config_item("currency");
$row = 1;
if (($handle = fopen("../../David_People.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
foreach ($data as $key => $val) {
# $data[$key] = utf8_encode($data[$key]);
}
$person = new person();
$person->currency = $cur;
$person->set_value("username", $data[0]);
$person->set_value("firstName", $data[1]);
$person->set_value("surname", $data[2]);
$person->set_value("password", encrypt_password($data[3]));
$person->set_value("emailAddress", $data[4]);
$person->set_value("phoneNo1", $data[5]);
$person->set_value("comments", $data[6]);
$person->set_value("perms", "employee");
$person->set_value("personActive", 1);
$person->set_value("personModifiedUser", $current_user->get_id());
$person->save();
$x++;
echo "<br>here: " . $person->get_id() . $data[0];
if ($x > 4) {
//die();
}
示例3: person
function store_prefs()
{
$p = new person();
$p->set_id($this->get_id());
$p->select();
$p->load_prefs();
$old_prefs = $p->prefs or $old_prefs = array();
foreach ($old_prefs as $k => $v) {
if ($this->prefs[$k] != $v) {
$save = true;
}
}
foreach ($this->prefs as $k => $v) {
if ($old_prefs[$k] != $v) {
$save = true;
}
}
if ($save || (!is_array($old_prefs) || !count($old_prefs))) {
$arr = serialize($this->prefs);
$p->set_value("sessData", $arr);
$p->currency = config::get_config_item('currency');
$p->save();
}
}