本文整理汇总了PHP中connection::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::fetch方法的具体用法?PHP connection::fetch怎么用?PHP connection::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::fetch方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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']);
}
}
示例8: connection
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>";
}
if ($chat->chatclosed($_REQUEST['idchat']) )
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;'></span> Your partner has left the chat</div>";
$con->execute("update users set time='" . time() . "' where iduser='{$_POST['iduser']}'");
if (!$chat->chatclosed($_REQUEST['idchat']) && $chat->getchatpartnerid($_POST['idchat'], $_POST['iduser']))
{
$timeout=time() - 10;
$con->execute(