本文整理匯總了PHP中FileData::exists方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileData::exists方法的具體用法?PHP FileData::exists怎麽用?PHP FileData::exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileData
的用法示例。
在下文中一共展示了FileData::exists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: header
$current_user_dept = $user_perms_obj->user_obj->getDeptId();
$data_id = $_REQUEST['id'];
// includes
$department_query = "SELECT department FROM {$GLOBALS['CONFIG']['db_prefix']}user WHERE id=:user_id";
$department_stmt = $pdo->prepare($department_query);
$department_stmt->bindParam(':user_id', $_SESSION['uid']);
$department_stmt->execute();
$result = $department_stmt->fetchAll();
if ($department_stmt->rowCount() != 1) {
header('Location:error.php?ec=14');
exit;
//non-unique error
}
$filedata = new FileData($data_id, $pdo);
// error check
if (!$filedata->exists()) {
header('Location:error.php?ec=2');
exit;
} else {
$category = $filedata->getCategory();
$realname = $filedata->getName();
$description = $filedata->getDescription();
$comment = $filedata->getComment();
$owner_id = $filedata->getOwner();
$department = $filedata->getDepartment();
//CHM
$table_name_query = "SELECT table_name FROM {$GLOBALS['CONFIG']['db_prefix']}udf WHERE field_type = '4'";
$table_name_stmt = $pdo->prepare($table_name_query);
$table_name_stmt->execute();
$result = $table_name_stmt->fetchAll();
$num_rows = $table_name_stmt->rowCount();