本文整理汇总了PHP中Mysql::ms方法的典型用法代码示例。如果您正苦于以下问题:PHP Mysql::ms方法的具体用法?PHP Mysql::ms怎么用?PHP Mysql::ms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mysql
的用法示例。
在下文中一共展示了Mysql::ms方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MATCH
$orderByUp = ', `eventUpInCatAll` DESC';
$eventFreezeTime = '`eventUpInCatAll`';
$and = '';
if (isset($_GET['cityId'])) {
$filters[] = '`spotCityId` = ' . (int) $_GET['cityId'] . ' ';
}
if (isset($_GET['catId'])) {
$filters[] = '`eventCatId` = ' . (int) $_GET['catId'] . ' ';
$orderByUp = ', `eventUpInCat` DESC';
$eventFreezeTime = '`eventUpInCat`';
}
if (isset($_GET['SubCatId'])) {
$filters[] = ' `eventSubCatId` = ' . (int) $_GET['SubCatId'] . ' ';
}
if (isset($_GET['textSearchRequest'])) {
$filters[] = ' MATCH (`eventName`,`eventInfo`) AGAINST (\'' . $dbConnection->ms($_GET['textSearchRequest']) . '\' IN BOOLEAN MODE) ';
}
$_GET['from'] = isset($_GET['from']) ? (int) $_GET['from'] : 0;
$_GET['amount'] = isset($_GET['amount']) ? (int) $_GET['amount'] : 10;
$and = count($filters) > 0 ? ' AND ' : '';
$query = $dbConnection->mq('
SELECT
*,
IF(`eventFreezeTime`>=NOW(),1,0) as VIP
FROM
`event`
INNER JOIN
`eventSpots`
ON
`eventSpotsEventId` = `eventId`
INNER JOIN
示例2: authorize
function authorize(Mysql $mysql)
{
if (!isset($_POST['email'], $_POST['pass'])) {
exit;
}
$query = $mysql->mq('
SELECT
`companyId`
FROM
`company`
WHERE
`companyMail` = "' . $mysql->ms($_POST['email']) . '"
AND
`companyPassword` = "' . Security::generatePassword($_POST['email'], $_POST['pass']) . '"
LIMIT 1
');
if ($query->num_rows) {
$_SESSION['userId'] = $mysql->assoc($query)['companyId'];
}
echo $query->num_rows;
}