本文整理汇总了PHP中Mysql::getLine方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::getLine方法的具体用法?PHP Mysql::getLine怎么用?PHP Mysql::getLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::getLine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserByProjectId
public function getUserByProjectId($projectId)
{
$mysql = new Mysql();
$sql = "SELECT GROUP_CONCAT(DISTINCT result.UserId) as Ids ,GROUP_CONCAT(DISTINCT result.name) as Names FROM (SELECT d.UserId,u.Name FROM " . $mysql->dbpre . "developer" . $mysql->debug . " as d ," . $mysql->dbpre . "user" . $mysql->debug . " as u WHERE d.UserId=u.UserId and ProjectId=" . intval($projectId) . " ) as result";
//echo $sql;
$result = $mysql->getLine($sql);
$mysql->closeDb();
return $result;
}
示例2: getModel
public function getModel($id)
{
$mysql = new Mysql();
$sql = "SELECT * FROM " . $mysql->dbpre . "project" . $mysql->debug . " WHERE Id=" . intval($id);
// var_dump( $sql );
// exit;
$result = $mysql->getLine($sql);
$mysql->closeDb();
return $result;
}
示例3: setValue
function setValue($id)
{
$mysql = new Mysql();
$sqlformat = "select Id,Name,NameUrl,Description,ChildCount,Status,DisplayOrder,ParentId,Property,Image,Belong from %scategory%s where id=%d and belong=%d";
$sql = sprintf($sqlformat, $mysql->dbpre, $mysql->debug, intval($id), intval($this->Belong));
$row = $mysql->getLine($sql);
$mysql->closeDb();
$this->Id = $row['Id'];
$this->Name = $row['Name'];
$this->NameUrl = $row['NameUrl'];
$this->ParentId = $row['ParentId'];
$this->Property = $row['Property'];
$this->Status = $row['Status'];
$this->DisplayOrder = $row['DisplayOrder'];
$this->Description = $row['Description'];
$this->Image = $row['Image'];
$this->Belong = $row['Belong'];
}
示例4: getPost
function getPost($id, $status)
{
$mysql = new Mysql();
$sql = "SELECT Id,ChildIds,Belong,Subject,Content,CategoryRoot,Status,DisplayOrder,CategoryIds,CommentStatus,CommentCount,Image,Creator,CreateDate,Tags,DigCount,ViewCount,Summary, CreatorDetail,Property,Source,Link,DisplayDate,Memo,Keywords from " . $mysql->dbpre . "post" . $mysql->debug . " where id=" . intval($id) . " and belong=" . intval($this->Belong);
if ($status != -1) {
$sql .= " and Status = " . intval($status);
}
$row = $mysql->getLine($sql);
$mysql->closeDb();
return $row;
}
示例5: getUserByLevel
public function getUserByLevel($deptId, $level)
{
$mysql = new Mysql();
$sql = "SELECT * FROM " . $mysql->dbpre . "user" . $mysql->debug . " WHERE Level=" . intval($level) . " AND Department=" . intval($deptId) . " LIMIT 1";
// var_dump( $sql );
// exit;
$result = $mysql->getLine($sql);
$mysql->closeDb();
return $result;
}