本文整理匯總了PHP中dao::inster方法的典型用法代碼示例。如果您正苦於以下問題:PHP dao::inster方法的具體用法?PHP dao::inster怎麽用?PHP dao::inster使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dao
的用法示例。
在下文中一共展示了dao::inster方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addMe
public function addMe($nick, $password, $email, $name)
{
$dao = new dao();
$product = array("nick" => $nick, "password" => $password, "email" => $email, "name" => $name);
try {
$returnObject = $dao->inster($product, "product");
} catch (Exception $e) {
throw new Exception("Failed product addMe: " . $e->getMessage());
}
return $this->addData($returnObject);
}
示例2: addMe
public function addMe($nick, $password, $email, $name)
{
$dao = new dao();
$club = array("email" => $email, "name" => $name);
try {
$returnObject = $dao->inster($club, "club");
} catch (Exception $e) {
throw new Exception("Failed club addMe: " . $e->getMessage());
}
return $this->addData($returnObject);
}
示例3: addMe
public function addMe($id_event, $id_product, $id_user, $date_ini)
{
$dao = new dao();
$product = array("id_event" => $id_event, "id_product" => $id_product, "id_user" => $id_user, "date_ini" => $date_ini);
try {
$returnObject = $dao->inster($product, "product");
} catch (Exception $e) {
throw new Exception("Failed product addMe: " . $e->getMessage());
}
return $this->addData($returnObject);
}
示例4: inviteFriend
public function inviteFriend($user_id, $event_id)
{
$dao = new dao();
$event_user = array("id_event" => $event_id, "id_user" => $user_id);
try {
$dao->inster($event_user, "event_user");
return $event_user;
} catch (Exception $e) {
throw new Exception("Failed event_user addMe: " . $e->getMessage());
}
}
示例5: post
public function post($user_id, $coment, $media)
{
$timestamp = new DateTime();
$id_post = hash('md5', $timestamp->getTimestamp() . $user_id);
$dao = new dao();
$post = array("id_post" => $id_post, "coment" => $coment, "media" => $media);
$post_user = array("id_user" => $user_id, "id_post" => $id_post);
try {
$returnObject = $dao->inster($post, "post");
$returnObject = $dao->inster($post_user, "post_user");
return $returnObject;
} catch (Exception $e) {
throw new Exception("Failed conecting posting " . $wantToFollow_id . " Message: " . $e->getMessage());
}
}