本文整理汇总了PHP中Record::quote方法的典型用法代码示例。如果您正苦于以下问题:PHP Record::quote方法的具体用法?PHP Record::quote怎么用?PHP Record::quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record::quote方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_unique
public function is_unique()
{
$result = array('is_ok' => true, 'message' => 'Record is unique!');
if (Record::find('first', array('conditions' => 'name = ' . Record::quote($this->name) . ' AND type = ' . Record::quote($this->type) . ' AND content = ' . Record::quote($this->content)))) {
$result['is_ok'] = false;
$result['message'] = "Record already exists!";
return $result;
}
/*
* Consistany check for SOA records, only allowed once at a domain
*/
if ($this->type === SOA) {
if (Record::find('first', array('conditions' => 'domain_id = ' . Record::quote($this->domain_id) . ' AND type = ' . Record::quote($this->type)))) {
$result['is_ok'] = false;
$result['message'] = "Soa record only allowed once at a domain!";
return $result;
}
}
return $result;
}
示例2: exit
$start = $_GET["start"];
}
print $display->header();
if (!preg_match('/^\\d+$/', $_GET['id'])) {
print $display->error("You hacker!");
print $display->footer();
exit(1);
}
try {
$d = Domain::find($_GET['id']);
$result = ActiveRecord::query("SELECT COUNT(*) AS count FROM records WHERE domain_id={$d->id}");
$rCount = (int) $result[0]['count'];
if ($rCount > $rowamount) {
$findResult = Record::find('all', array('limit' => "{$rowamount}", 'offset' => "{$offset}", 'conditions' => 'domain_id = ' . Record::quote($d->id), 'order' => 'name'));
} else {
$findResult = Record::find('all', array('conditions' => 'domain_id = ' . Record::quote($d->id), 'order' => 'name'));
}
} catch (Exception $e) {
print $e->getMessage();
print $display->footer();
exit(0);
}
?>
<script language="JavaScript" src="http://www.mattkruse.com/javascript/datadumper/datadumper.js"></script>
<script type="text/javascript">
function queue_record_edit_all() {
$$('form').each(function(form) {
if(form.disabled == undefined) {
示例3: isset
<input type="text" name="query" value="<?php
echo isset($_GET['query']) ? $_GET['query'] : '';
?>
">
<input type="submit" name="submit" value="Search">
</form>
<?php
if ($_GET["query"]) {
$dFindResult = Domain::get_all(array('conditions' => 'd.name LIKE ' . Domain::quote($_GET['query'])));
if (is_array($dFindResult) && count($dFindResult) > 0) {
print '<h2>Domains (' . count($dFindResult) . ')</h2>';
print $display->domains_header();
foreach ($dFindResult as $domain) {
print $display->domain($domain);
}
print $display->domains_footer();
print '<br>';
}
flush();
$rFindResult = Record::find('all', array('conditions' => 'name LIKE ' . Record::quote($_GET['query']) . ' OR ' . 'content LIKE ' . Record::quote($_GET['query']), 'order' => 'name'));
if (is_array($rFindResult) && count($rFindResult) > 0) {
print '<h2>Records (' . count($rFindResult) . ')</h2>';
print $display->records_header();
foreach ($rFindResult as $record) {
print $display->record($record);
}
print $display->records_footer();
}
}
print $display->footer();