本文整理汇总了PHP中SQLQuery::selectWhatWhere方法的典型用法代码示例。如果您正苦于以下问题:PHP SQLQuery::selectWhatWhere方法的具体用法?PHP SQLQuery::selectWhatWhere怎么用?PHP SQLQuery::selectWhatWhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLQuery
的用法示例。
在下文中一共展示了SQLQuery::selectWhatWhere方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$dataInsert = array();
$fullname = explode(" ", $content->name);
$fname = "Britney";
$lname = "Spears";
if (count($fullname) > 0) { $fname = $fullname[0]; }
if (count($fullname) > 1) { $lname = $fullname[1]; }
$dataInsert['tw_id'] = $content->id;
$dataInsert['fname'] = $fname;
$dataInsert['lname'] = $lname;
$dataInsert['tw_name'] = $content->screen_name;
$dataInsert['avatar'] = $content->profile_image_url;
$dataInsert['tw_oauth_token'] = $access_token['oauth_token'];
$dataInsert['tw_oauth_token_secret'] = $access_token['oauth_token_secret'];
$user = $DB->selectWhatWhere("*", "tw_id = " . $content->id);
$update_success = 0;
$user_id = 0;
if (empty($user)) {
$update_success = $DB->addItemsArray($dataInsert);
$user_id = $DB->getLastId();
} else {
$user_id = $user[0]["users"]["id"];
$update_success = $DB->updateWhatWhereArray2($dataInsert, "id = " . $user_id);
}
if ($update_success == 0) {
$_SESSION['status'] = 'error';
} else {
$_SESSION['user_id'] = $user_id;
$_SESSION['twitter_uid'] = $content->id;
}