本文整理匯總了PHP中DbUtil::getLineId方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbUtil::getLineId方法的具體用法?PHP DbUtil::getLineId怎麽用?PHP DbUtil::getLineId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbUtil
的用法示例。
在下文中一共展示了DbUtil::getLineId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DbUtil
<!DOCTYPE html>
<?php
require_once '../db.php';
$Database = new DbUtil();
$userName = $Database->getUserName();
if ($userName == null) {
header('Location: ../login.php', true, 303);
exit;
}
$ID = $_GET['id'];
$LINE = $_GET['line'];
$stopData = $Database->getStop($ID);
$lineId = $Database->getLineId($LINE, $userName);
if ($lineId == null) {
$Database->registerLine($LINE, $userName);
}
$lineId = $Database->getLineId($LINE, $userName);
$Database->registerLineToStop($ID, $lineId);
header("Location: stopdata.php?id={$ID}", true, 303);
示例2: DbUtil
require_once 'sidemenu.php';
$DO = @$_GET['do'];
$EDIT = @$_GET['edit'];
$DELETE = @$_GET['delete'];
$Database = new DbUtil();
$userName = $Database->getUserName();
if ($DO != "") {
$stopName = $_POST['stopName'];
if ($_POST['stopSelect'] == 'new') {
$lineName = $_POST['newName'];
} else {
$lineName = $_POST['existSelect'];
}
$lat = @$_POST['lat'];
$long = @$_POST['long'];
$lineId = $Database->getLineId($lineName, $userName);
if ($lineId == null) {
$Database->registerLine($lineName, $userName);
$lineId = $Database->getLineId($lineName, $userName);
}
if ($lat == '') {
$lat = '0';
$long = '0';
}
if ($EDIT == "") {
$Database->registerStop($stopName, $userName, $long, $lat);
} else {
$Database->updateStop($EDIT, $stopName, $userName, $long, $lat);
}
header('Location: ttbl.php', true, 303);
exit;