本文整理汇总了PHP中connection::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::execute方法的具体用法?PHP connection::execute怎么用?PHP connection::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::execute方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchOne
public static function fetchOne($sql)
{
$con = new connection();
$con->execute($sql);
$con->fetch();
return $con->rows;
}
示例2: dateExists
function dateExists()
{
$date = date('Y-m-d', strtotime($_GET['date']));
$sql = "SELECT COUNT(*) AS count FROM ipodate WHERE ipodate = '" . mysql_escape_string($date) . "'";
$con = new connection();
$con->execute($sql);
die($con->fetch());
}
示例3: useralive
function useralive($userid)
{
$con= new connection();
$con->execute("select time from users where iduser='$userid'");
$con->fetch();
$time1= $con->rows['time'];
if ($time1<(time()-13))
return false;
else
return true;
}
示例4: getSymbols
function getSymbols()
{
// get a list of IPOs from database that are missing the ipoprice
$sql = "SELECT DISTINCT symbol FROM ipo WHERE ipoprice IS NULL";
$con = new connection();
$con->execute($sql);
$symbols = array();
while ($con->fetch()) {
$symbols[] = $con->rows["symbol"];
}
return $symbols;
}
示例5: getSymbols
function getSymbols()
{
// get a list of all IPOs that don't have first day open/close price set
$sql = "SELECT DISTINCT symbol, ipodate FROM ipo WHERE closeprice = 0 OR openprice = 0";
$con = new connection();
$con->execute($sql);
$symbols = array();
while ($con->fetch()) {
$symbols[] = array("symbol" => $con->rows["symbol"], "ipodate" => $con->rows["ipodate"]);
}
return $symbols;
}
示例6: symbolsNoScore
function symbolsNoScore()
{
// get a list of IPOs and their dates from the database that are missing tweets/hype or are in the future
$sql = "SELECT DISTINCT symbol, ipodate FROM ipo WHERE hype IS NULL OR ipodate >= CURDATE()";
$con = new connection();
$con->execute($sql);
$symbols = array();
while ($con->fetch()) {
$symbol = array();
$symbol["symbol"] = $con->rows["symbol"];
$symbol["ipodate"] = strtotime($con->rows["ipodate"]);
$symbols[] = $symbol;
}
return $symbols;
}
示例7: connection
<?php
include "../database/connection.php";
$conn = new connection();
$conn->connectdb('wisma', 'wisma');
$str = "INSERT INTO FASILITAS VALUES('" . $_POST["id_fasilitas"] . "','" . $_POST["nama_fasilitas"] . "')";
echo $str;
$conn->execute($str);
header("location: ../tambah_fasilitas.php");
示例8: users
<?
include("connection.php");
include("classes/users.class.php");
include("classes/chat.class.php");
$user= new users();
if (!$user->isuser($_REQUEST['device']))
{
header("location: newuser.php?device=".$_REQUEST['device']);
exit();
}
$con= new connection();
$con->execute("update users set time='" . time() . "' where iduser='{$user->id}'");
$chat= new chat();
$chat->closedeadrooms();
if(!$chatid=$_GET['idchat'])
{
if ($chatid=$chat->findchat($user->id))
{
//echo "found chat";
$chat->joinchat($chatid,$user->id);
}else{
$chatid=$chat->createchat($user->id);
//echo "created chat";
示例9: closedeadrooms
function closedeadrooms()
{
$con= new connection();
$con->execute("select idchat, user1, user2, full from chat where closed<>'Y'");
while($con->fetch())
{
$user= new users();
if ($user->useralive($con->rows['user1'])==false)
$this->closeroom($con->rows['idchat']);
if ($user->useralive($con->rows['user2'])==false && $con->rows['full']=='Y')
$this->closeroom($con->rows['idchat']);
}
}
示例10: connection
<?php
include "../database/connection.php";
$conn = new connection();
$conn->connectdb('wisma', 'wisma');
$conn->execute("DELETE FROM KAMAR WHERE NO='" . $_GET['id_kamar'] . "'");
//echo "DELETE FROM KAMAR WHERE NO=".$_GET['id_kamar'];
header("Location: ../tambah_kamar.php");
示例11: connection
<?php
include './database/connection.php';
$my_connection = new connection();
$my_connection->connectdb('wisma', 'wisma');
$str = "INSERT INTO KAMAR VALUES('" . $_POST['no_kamar'] . "','" . $_POST['kelas'] . "'," . $_POST['harga'] . "," . $_POST['kapasitas'] . ",'" . $_POST['wisma'] . "')";
echo $str;
$my_connection->execute($str);
header("Location: tambah_kamar.php");
?>
示例12: users
$user=new users();
$chat=new chat();
$count=$user->getusercount();
if (!$chat->chatclosed($_REQUEST['idchat']))
{
if ($partner=$chat->getchatpartner($_REQUEST['idchat'], $_REQUEST['iduser']))
echo "<b>Chatting with $partner</b>";
else
echo "<b>Waiting for chat partner</b>";
}
else
echo "<b>Partner has left the chat</b>";
echo " - $count Users Online!";
$con=new connection();
$con->execute("select * from text where idchat='" . $_REQUEST['idchat'] . "' ");
$count=$con->numRows();
/*
if ($count > 12)
$start=$count - 12;
else
$start=0;
*/
$con->execute("select * from text where idchat='" . $_REQUEST['idchat'] . "'");
while ($con->fetch())
{
$name = $user->getname($con->rows['iduser']);
$txt=stripslashes($con->rows['text']);
echo "<div style='margin:2px; padding:5px; width:290px; color:#333333; font-size:11px; font-family:\"lucida grande\",tahoma,verdana,arial,sans-serif; background-color:#ECEFF5; '><span style='font-weight:bold;color:#3B5998; text-transform:capitalize; margin-right:3px;'>$name</span> {$txt}</div>";
}
示例13: connection
<?php
include "../database/connection.php";
$conn = new connection();
$conn->connectdb('wisma', 'wisma');
$conn->execute("DELETE FROM FASILITAS WHERE ID_FASILITAS='" . $_GET['id_fasilitas'] . "'");
//echo "DELETE FROM KAMAR WHERE NO=".$_GET['id_kamar'];
header("Location: ../tambah_fasilitas.php");