本文整理汇总了PHP中connection::setsql方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::setsql方法的具体用法?PHP connection::setsql怎么用?PHP connection::setsql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::setsql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connection
<?php
header('Content-Type: application/json; charset=utf-8');
require_once 'connection.php';
session_start();
if (isset($_SESSION['userid'])) {
$user = $_SESSION['userid'];
$connect = new connection();
$connect->connect();
$number = $connect->escapestring($_GET["number"]);
$sql = "SELECT `mailid`,`senderid`,`empfaengerid`,`text` FROM `mail` WHERE (`senderid` = " . $user . " OR `empfaengerid` = " . $user . ") order by `gesendet` LIMIT " . $number;
$connect->setsql($sql);
$row = $connect->getmap();
echo json_encode($row);
}
示例2: connection
<?php
header('Content-Type: application/json; charset=utf-8');
require_once 'connection.php';
$user = $_GET["user"];
$connect = new connection();
$connect->setsql("SELECT * FROM `profil` WHERE id=" . $user);
$connect->connect();
$row = $connect->getarray();
if ($row['sex'] == '0') {
$sex = "keine Angabe";
}
if ($row['sex'] == '1') {
$sex = "Männlich";
}
if ($row['sex'] == '2') {
$sex = "Weiblich";
}
if ($row['orientierung'] == '0') {
$ori = "keine Angabe";
}
if ($row['orientierung'] == '1') {
$ori = "Heterosexuel";
}
if ($row['orientierung'] == '2') {
$ori = "Homosexuel";
}
if ($row['orientierung'] == '3') {
$ori = "Bisexuel";
}
if ($row['orientierung'] == '4') {