当前位置: 首页>>代码示例>>PHP>>正文


PHP DibiConnection::fetchSingle方法代码示例

本文整理汇总了PHP中DibiConnection::fetchSingle方法的典型用法代码示例。如果您正苦于以下问题:PHP DibiConnection::fetchSingle方法的具体用法?PHP DibiConnection::fetchSingle怎么用?PHP DibiConnection::fetchSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DibiConnection的用法示例。


在下文中一共展示了DibiConnection::fetchSingle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: moveFile

 public function moveFile($fileId, $id, $fromFileId = false)
 {
     if ($fromFileId) {
         $folderId = $this->connection->fetchSingle("SELECT [folder_id] FROM [:vd:pages_files] WHERE [file_id]=%i", $fromFileId);
         if ($folderId) {
             return $this->connection->query("UPDATE [:vd:pages_files] SET [folder_id]=%i WHERE [file_id]=%i", $folderId, $fileId);
         } else {
             throw new \Exception('Destination folder not found.');
         }
     }
     return $this->connection->query("UPDATE [:vd:pages_files] SET [folder_id]=%i WHERE [file_id]=%i", $id, $fileId);
 }
开发者ID:jurasm2,项目名称:bubo,代码行数:12,代码来源:DriveModel.php

示例2: DibiConnection

<?php

require_once 'vendor/autoload.php';
require_once 'config.php';
use Dibi\Dibi;
$db = new DibiConnection($database_configuration);
if (isset($_COOKIE['language'])) {
    $locale = $db->fetchSingle('SELECT locale FROM Languages WHERE code="' . $_COOKIE['language'] . '"');
    putenv("LC_ALL={$locale}");
    setlocale(LC_ALL, $locale);
    bindtextdomain($text_domain, $base_dir . "/i18n");
    textdomain($text_domain);
}
switch (isset($_GET['q']) ? $_GET['q'] : '') {
    case "selectlanguage":
        $rows = $db->query("SELECT code, name FROM Languages WHERE supported = 1");
        echo "<option value='' selected></option>";
        foreach ($rows as $row) {
            echo "<option value='" . $row['code'] . "'>" . $row['name'] . "</option>";
        }
        break;
    case "savetext":
        $language = mysql_real_escape_string(isset($_POST['language']) ? $_POST['language'] : '');
        // It will be possible to use Null Coalesce Operator in PHP 7, see: https://wiki.php.net/rfc/isset_ternary
        $title = mysql_real_escape_string(isset($_POST['title']) ? $_POST['title'] : '');
        $text = mysql_real_escape_string(isset($_POST['text']) ? $_POST['text'] : '');
        $level = mysql_real_escape_string(isset($_POST['level']) ? $_POST['level'] : '');
        $source = mysql_real_escape_string(isset($_POST['source']) ? $_POST['source'] : '');
        $url = mysql_real_escape_string(isset($_POST['url']) ? $_POST['url'] : '');
        $public = mysql_real_escape_string(isset($_POST['pub']) ? $_POST['pub'] : '');
        $db->query("INSERT INTO Texts (language,title,text,level,source,url,public) VALUES ('" . $language . "','" . $title . "','" . $text . "','" . $level . "','" . $source . "','" . $url . "','" . $public . "')");
开发者ID:WesleyYep,项目名称:text2test,代码行数:31,代码来源:query.php

示例3: existsRepositoryWithName

 /**
  * @param string $repositoryName
  * @return boolean
  */
 protected function existsRepositoryWithName($repositoryName)
 {
     return (bool) $this->dibiConnection->fetchSingle("SHOW TABLES LIKE %s;", $repositoryName);
 }
开发者ID:lordjim666,项目名称:data-storage-mysql,代码行数:8,代码来源:MySQL.php

示例4: DibiConnection

<?php

require_once '../vendor/autoload.php';
require_once '../config.php';
use Dibi\Dibi;
$db = new DibiConnection($database_configuration);
if (isset($_COOKIE['language'])) {
    $currentLanguage = $_COOKIE['language'];
} else {
    $currentLanguage = $default_language;
}
$locale = $db->fetchSingle('SELECT locale FROM Languages WHERE code="' . $currentLanguage . '"');
putenv("LC_ALL={$locale}");
setlocale(LC_ALL, $locale);
bindtextdomain($text_domain, $base_dir . "/i18n");
textdomain($text_domain);
echo 'var currentLanguageI18n = "' . $currentLanguage . '",';
echo 'showSolutionI18n = "' . _('Show the solution') . '",';
echo 'showOriginI18n = "' . _('Show the original text') . '",';
echo 'showTestI18n = "' . _('Show the test') . '",';
echo 'checkTestI18n = "' . _('Check the test') . '",';
echo 'textIsPerfectI18n = "' . _('The text is perfect now.') . '",';
echo 'textIsNotCorrectI18n = "' . _('The text is not quite correct yet.') . '",';
echo 'selectLanguageI18n = "' . _('Choose your language') . '",';
echo 'selectLevelI18n = "' . _('Choose your language level') . '",';
echo 'levelI18n = "' . _('Language level') . '",';
echo 'selectTextI18n = "' . _('Choose a text') . '",';
echo 'selectTestTypeI18n = "' . _('Choose a test type') . '",';
echo 'formTextI18n = "' . _('or insert a text here.') . '",';
echo 'formTitleInfoTextI18n = "' . _('Would you like to save the text to the database?') . '",';
echo 'formTitleInfoTestI18n = "' . _('Would you like to save the test to the database?') . '",';
开发者ID:WesleyYep,项目名称:text2test,代码行数:31,代码来源:main.js.php

示例5: setcookie

    $minimise = ".min";
} else {
    $minimise = "";
}
$row = $db->fetch('SELECT * FROM Tests WHERE secret="' . $secret . '" LIMIT 1');
$language = $row->language;
$textId = (int) $row->text;
$testTypeId = (int) $row->testtype;
$testText = $row->test;
$solution = $row->solution;
$level = $row->level;
$save = (bool) $row->save;
$public = (bool) $row->public;
if (strlen($language) == 2) {
    setcookie('language', $language);
    $locale = $db->fetchSingle('SELECT locale FROM Languages WHERE code="' . $language . '"');
} else {
    $language = $default_language;
    if (isset($_COOKIE['language'])) {
        $locale = $db->fetchSingle('SELECT locale FROM Languages WHERE code="' . $_COOKIE['language'] . '"');
    } else {
        setcookie('language', $default_language);
        $locale = $db->fetchSingle('SELECT locale FROM Languages WHERE code="' . $default_language . '"');
    }
}
if ($language != "en") {
    putenv("LC_ALL={$locale}");
    setlocale(LC_ALL, $locale);
    bindtextdomain($text_domain, $base_dir . "/i18n");
    textdomain($text_domain);
}
开发者ID:WesleyYep,项目名称:text2test,代码行数:31,代码来源:test.php


注:本文中的DibiConnection::fetchSingle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。