本文整理汇总了PHP中con函数的典型用法代码示例。如果您正苦于以下问题:PHP con函数的具体用法?PHP con怎么用?PHP con使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了con函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ex
function ex($pytanie)
{
con();
$result = mysql_query($pytanie);
if ($result > 0) {
return 1;
} else {
return 0;
}
}
示例2: regMatch
/**
*
*/
function regMatch($pattern, $str)
{
con(is_string($pattern), "regMatch()", "pattern must be string: ", $pattern);
con(is_string($str), "regMatch()", "str must be string: ", $str);
$retval = preg_match($pattern, $str, $matches);
con($retval !== false, "regMatch()", "preg_match() returned false: ", $str);
$r1 = $retval === 1;
$r2 = $retval !== 0;
$r3 = count($matches) !== 0;
con($r1 === $r2, "regMatch()", "invariance test 1 failed: ", $r1, $r2);
con($r1 === $r3, "regMatch()", "invariance test 2 failed: ", $r1, $r3);
return $r1;
}
示例3: _tpl_act_changes
function _tpl_act_changes(&$event, $param)
{
global $TEXT;
global $PRE;
global $SUF;
if ('changes' != $event->data) {
return;
}
html_edit($TEXT);
echo '<br id="scroll__here" />';
html_diff(con($PRE, $TEXT, $SUF));
$event->preventDefault();
return;
}
示例4: geraJsonCidades
function geraJsonCidades($estadosId)
{
$query = con()->query("Select * from cidades where estado_id = {$estadosId} order by cidade_nome");
$cidades = $query->fetchAll();
$stringJson = "{\"Cidades\":[";
for ($i = 0; $i < count($cidades); $i++) {
$stringJson .= "{\"id\":\"" . $cidades[$i]["cidade_id"] . "\",\"nome\":\"" . utf8_encode($cidades[$i]["cidade_nome"]) . "\"}";
if ($i < count($cidades) - 1) {
$stringJson .= ",";
}
}
$stringJson .= "]}";
return $stringJson;
}
示例5: act_save
/**
* Handle 'save'
*
* Checks for spam and conflicts and saves the page.
* Does a redirect to show the page afterwards or
* returns a new action.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function act_save($act)
{
global $ID;
global $DATE;
global $PRE;
global $TEXT;
global $SUF;
global $SUM;
global $lang;
global $INFO;
//spam check
if (checkwordblock()) {
msg($lang['wordblock'], -1);
return 'edit';
}
//conflict check
if ($DATE != 0 && $INFO['meta']['date']['modified'] > $DATE) {
return 'conflict';
}
//save it
saveWikiText($ID, con($PRE, $TEXT, $SUF, 1), $SUM, $_REQUEST['minor']);
//use pretty mode for con
//unlock it
unlock($ID);
//delete draft
act_draftdel($act);
session_write_close();
// when done, show page
return 'show';
}
示例6: pointsGagne
function pointsGagne($question, $auteur)
{
$con = con();
$res = mysqli_query($con, "select count(id) from votes where auteur=''");
$row = mysqli_fetch_array($res);
if ($row == NULL) {
return FALSE;
}
return TRUE;
mysqli_close($con);
}
示例7: con
<hr>
<div class="flatlistcontainer">
<?php
$query = "SELECT * FROM `filter` WHERE `display` = '1' AND `userid`='{$userid}'";
$con = con();
$res = $con->query($query);
while ($arr = $res->fetch_array()) {
$id = $arr['id'];
$query2 = "SELECT * FROM `notification` WHERE `sho` = '1' AND `filterid` = '{$id}' AND `userid`='{$userid}' ";
$con2 = con();
$res2 = $con2->query($query2);
while ($arr2 = $res2->fetch_array()) {
$houseid = $arr2['houseid'];
$query3 = "SELECT * FROM `flat` WHERE `id` = '{$houseid}' ";
$con3 = con();
$res3 = $con3->query($query3);
while ($arr3 = $res3->fetch_array()) {
if ($arr2['view'] == '1') {
echo "<div class=\"row flatlist\" style=\"background-color:blue\">";
} else {
echo "<div class=\"row flatlist\" style=\"background-color:white\">";
}
?>
<div class="col-md-12"><a href="modify.php?id=<?php
echo $id;
?>
&idd=<?php
echo $houseid;
?>
示例8: array
<?php
//Connect to multiple addresses using a single file
//useful for cronjobs
//By Thunder33345(twitter.com/thunder33345)
//2016/1/17
$site = array("https://192.168.1.1");
function con($site)
{
if (file_get_contents("{$site}")) {
echo 1;
echo $site;
echo "||";
} else {
echo 0;
echo $site;
echo "||";
}
}
foreach ($site as &$val) {
con($val);
}
unset($val);
示例9: con
<?php
function con()
{
mysql_connect() or die('Could not connect: ' . mysql_error);
mysql_select_db('sloisel_numeric') or die('Could not select db: ' . mysql_error());
}
con();
if (isset($_POST['savedata'])) {
$data = $_POST['savedata'];
if (get_magic_quotes_gpc()) {
$data = stripslashes($data);
}
json_decode($data) or die("json error");
$f = hash('sha256', $data);
if ($f === "") {
exit;
}
$d = mysql_real_escape_string($data);
$q = "insert ignore into blobs value ('{$f}','{$d}')";
$result = mysql_query($q) or die('Could not save script: ' . mysql_error());
header('Location: workshop.php?link=' . $_GET['link']);
exit;
}
?>
WORKSHOPHTML
<script>
<?php
$incs = NULL;
示例10: get_single_assoc
/**
* Hard to generalise together with get_single_row(), because they call different functions.
*/
function get_single_assoc($sql)
{
$query = $this->query($sql);
$row1 = $query->tryGetAssoc();
con(is_array($row1), "get_single_assoc()", "Denne query gav intet resultat.");
$row2 = $query->tryGetAssoc();
con($row2 === false, "get_single_assoc()", "query må kun returneres én row: ", $row1, $row2);
return $row1;
}
示例11: supprVote2
function supprVote2($reponse)
{
$con = con();
$stmt = mysqli_prepare($con, "DELETE FROM votes WHERE reponse = ? ");
mysqli_stmt_bind_param($stmt, 'i', $reponse);
mysqli_stmt_execute($stmt);
mysqli_close($con);
}
示例12: session_start
<?php
session_start();
$id1 = $_SESSION['userid'];
include 'function.php';
$query = "select distinct user1,user2 from messages where user1='{$id1}' OR user2='{$id1}'";
$con = con();
$res = $con->query($query);
while ($arr = $res->fetch_array()) {
if ($id1 == $arr['user1']) {
$user2 = $arr['user2'];
$query1 = "select * from user where id='{$user2}'";
$con1 = con();
$res1 = $con1->query($query1);
while ($arr1 = $res1->fetch_array()) {
echo "<a href=\"chatindex.php?id2=" . $arr['user2'] . "\">" . $arr1['name'] . "</a>";
echo "<br>";
}
} else {
$user1 = $arr['user1'];
$query1 = "select * from user where id='{$user1}'";
$con1 = con();
$res1 = $con1->query($query1);
while ($arr1 = $res1->fetch_array()) {
echo "<a href=\"chatindex.php?id2=" . $arr['user1'] . "\">" . $arr1['name'] . "</a>";
echo "<br>";
}
}
}
?>
</body>
</html>
示例13: con
</div>
</div>
</div>
</div>
<div class="wlistdetails">
<h1 style="font-family: 'PT Sans Narrow', sans-serif;">Wishlist</h1>
<hr>
<div class="wlistcontainer">
<?php
$query7 = "select * from wishlist where buyerid='{$userid}' AND sho='1' ";
$con7 = con();
$res7 = $con7->query($query7);
while ($arr7 = $res7->fetch_array()) {
$sellerid = $arr7['sellerid'];
$houseid = $arr7['houseid'];
$wishid = $arr7['id'];
$query8 = "select * from user where id='{$sellerid}'";
$res8 = $con->query($query8);
while ($arr8 = $res8->fetch_array()) {
$sellername = $arr8['name'];
$sellernum = $arr8['phnno'];
}
$query9 = "select * from flat where id='{$houseid}'";
$res9 = $con->query($query9);
while ($arr9 = $res9->fetch_array()) {
$houseno = $arr9['houseno'];
示例14: qry
function qry($sql)
{
$con = con();
$res = mysql_query($sql, $con);
return $res;
}
示例15: act_save
/**
* Handle 'save'
*
* Checks for spam and conflicts and saves the page.
* Does a redirect to show the page afterwards or
* returns a new action.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function act_save($act)
{
global $ID;
global $DATE;
global $PRE;
global $TEXT;
global $SUF;
global $SUM;
//spam check
if (checkwordblock()) {
return 'wordblock';
}
//conflict check //FIXME use INFO
if ($DATE != 0 && @filemtime(wikiFN($ID)) > $DATE) {
return 'conflict';
}
//save it
saveWikiText($ID, con($PRE, $TEXT, $SUF, 1), $SUM, $_REQUEST['minor']);
//use pretty mode for con
//unlock it
unlock($ID);
//delete draft
act_draftdel($act);
session_write_close();
// when done, show page
return 'show';
}