本文整理汇总了PHP中DBAccess::exec方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::exec方法的具体用法?PHP DBAccess::exec怎么用?PHP DBAccess::exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBAccess
的用法示例。
在下文中一共展示了DBAccess::exec方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
include_once "db.php";
$idDocument = $_REQUEST["id"];
// SQL
$idModele = DBAccess::singleValue("SELECT idModele\n FROM documentGamme, gamme, anneeModele\n WHERE documentGamme.idGamme=gamme.idGamme\n AND gamme.idAnneeModele = anneeModele.idAnneeModele\n AND idDocumentGamme='{$idDocument}'");
DBAccess::exec("UPDATE documentGamme\n SET emblem_modele=0\n WHERE idGamme IN\n (\n SELECT idGamme\n FROM gamme, anneeModele\n WHERE gamme.idAnneeModele = anneeModele.idAnneeModele\n AND idModele='{$idModele}'\n )");
DBAccess::exec("UPDATE documentGamme\n SET emblem_modele=1\n WHERE idDocumentGamme='{$idDocument}'");
$response = 'ok';
print json_encode($response, JSON_PRETTY_PRINT);
示例2:
<?php
include_once "db.php";
$idModele = $_REQUEST["idModele"];
$mini = $_REQUEST["mini"];
// SQL
DBAccess::exec("UPDATE modele\n SET mini = '{$mini}'\n WHERE idModele = '{$idModele}'");
include_once "list-mini.php";
示例3: getParam
$status['query'] = "UPDATE documentMarque\n\t\t\t\t\t\t\t\t\t\t\t\t SET idMarque='{$idMarque}', ordre='{$ordre}', source='{$source}', date='{$date}', legende='{$legende}', motCle='{$motCle}'\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE idDocumentMarque = '{$idDocumentMarque}'";
}
} else {
if ($objet == "docGamme") {
$idGamme = getParam("idGamme");
$source = getParam("source");
$date = getParam("date");
$legende = getParam("legende");
$lien = getParam("lien");
if ($action == "add") {
$status['query'] = "INSERT INTO documentGamme(idGamme, source, date, legende, lien)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t VALUES('{$idGamme}', '{$source}', '{$date}', '{$legende}', '{$lien}')";
} else {
$idDocumentGamme = getParam("idDocumentGamme");
$status['query'] = "UPDATE documentGamme\n\t\t\t\t\t\t\t\t\t\t\t\t SET idGamme='{$idGamme}', source='{$source}', date='{$date}', legende='{$legende}', lien='{$lien}'\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE idDocumentGamme = '{$idDocumentGamme}'";
}
}
}
}
}
}
$status['result'] = DBAccess::exec($status['query']) ? "ok" : "ko";
if ($action == "add") {
if ($objet == "docMarque") {
$status['new'] = DBAccess::singleValue("SELECT max(idDocumentMarque) as id FROM documentMarque");
} else {
if ($objet == "docGamme") {
$status['new'] = DBAccess::singleValue("SELECT max(idDocumentGamme) as id FROM documentGamme");
}
}
}
print json_encode($status, JSON_PRETTY_PRINT);