本文整理汇总了PHP中project::searchByKey方法的典型用法代码示例。如果您正苦于以下问题:PHP project::searchByKey方法的具体用法?PHP project::searchByKey怎么用?PHP project::searchByKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project
的用法示例。
在下文中一共展示了project::searchByKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
*/
session_start();
// requireLogin();
include "conf/site.php";
include "libs/php/globals.php";
$app_root = dirname(__FILE__) . "/";
include $app_root . "model/project.php";
$s = new sql();
$d['errors'] = true;
$d['success'] = false;
$d['message'] = "Unknown error";
if (isset($_GET['p'])) {
$id = clean($_GET['p']);
if ($_GET['p'] != "") {
$p = new project();
$p->searchByKey("project_name", $id);
$d['message'] = "Query executed with success " . $id . ".";
$d['numrows'] = $p->numRows();
if ($p->numRows() < 1) {
$d['message'] = "No project matches " . $id . ".";
$d['bestmatch'] = "";
$d['success'] = false;
} else {
$row = $p->getNext();
$d['message'] = "We have a result for " . $id . ".";
$d['bestmatch'] = $row['project_name'];
if ($row['project_name'] == $id) {
$d['success'] = true;
$d['descr'] = $row['descr'];
}
}