本文整理汇总了PHP中RunSQL函数的典型用法代码示例。如果您正苦于以下问题:PHP RunSQL函数的具体用法?PHP RunSQL怎么用?PHP RunSQL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RunSQL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Migrate_20_21
/**
* \brief Migrate to the uploadtree_a table
*
* \param $DryRun Do not create the table, just print the sql.
*
* \return 0 on success, 1 on failure
**/
function Migrate_20_21($DryRun)
{
// Check if uploadtree_a already inherits from uploadtree. If so, we are done.
$sql = "SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_inherits WHERE inhrelid = 'public.uploadtree_a'::regclass::oid);";
$row = RunSQL($sql, $DryRun);
/** on fedora 18, the column name is 'exist', on other distritution, it is '?column?' */
foreach ($row as $exist_key => $exist_value) {
}
if (@$exist_value == 't') {
if ($DryRun) {
echo __FUNCTION__ . ": Data previously migrated.\n";
}
return 0;
// migration has already happened
}
// Is there data in uploadtree? If so then we need to migrate
$sql = "select uploadtree_pk from uploadtree limit 1";
$row = RunSQL($sql, $DryRun);
if (!empty($row)) {
echo "Migrating existing uploadtree data.\n";
// drop uploadtree_a, it was put there by core schema for new installs only.
$sql = "drop table uploadtree_a";
RunSQL($sql, $DryRun);
// rename uploadtree to uploadtree_a
$sql = "alter table uploadtree rename to uploadtree_a";
RunSQL($sql, $DryRun);
// create new uploadtree table
$sql = "create table uploadtree (like uploadtree_a INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES)";
RunSQL($sql, $DryRun);
// Fix the foreign keys that moved when the table was renamed
$sql = "alter table uploadtree add foreign key (upload_fk) references upload(upload_pk) on delete cascade";
RunSQL($sql, $DryRun);
}
// Fix the forieign keys removed when the table was renamed
$sql = "SELECT conname from pg_constraint where conname= 'uploadtree_a_upload_fk_fkey';";
$row = RunSQL($sql, $DryRun);
if (empty($row)) {
$sql = "alter table uploadtree_a add foreign key (upload_fk) references upload(upload_pk) on delete cascade";
RunSQL($sql, $DryRun);
}
// fix uploadtree_tablename
$sql = "update upload set uploadtree_tablename='uploadtree_a' where uploadtree_tablename is null";
RunSQL($sql, $DryRun);
// have uploadtreee_a inherit uploadtree
$sql = "alter table uploadtree_a inherit uploadtree";
RunSQL($sql, $DryRun);
return 0;
// success
}
示例2: session_start
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
session_start();
header("Expires: Mon, 20 Jul 2000 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);
header("Pragma: no-cache");
set_time_limit(0);
opendb();
$id = str_replace("'", "''", NNull($_GET['id'], ''));
RunSQL("delete from pointsofinterest where id=" . $id);
RunSQL("delete from alarms where poiid=" . $id);
print "GeoFence was successfully deleted !";
closedb();
示例3: session_start
<?php
include "../include/db.php";
include "../include/functions.php";
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
session_start();
header("Content-type: text/html; charset=utf-8");
?>
<?php
$table = getQUERY("table");
$id = getQUERY("id");
opendb();
RunSQL("delete from " . $table . " where id = " . $id);
if ($table == 'fmCosts') {
RunSQL("delete from newcosts where costtypeid = " . $id);
}
closedb();
示例4: nnull
}
$toobject = nnull(getQUERY("toobj"), "");
$flag = '0';
$delivery = "";
$deliverycoll = "";
if ($action == 'user') {
$fromid = session("user_id");
if ($toobject == 'vehicle') {
$toid = nnull(getQUERY("toid"), "");
$toid = dlookup("select id from vehicles where gsmnumber='" . $toid . "'");
} else {
$flag = '1';
$toid = nnull(getQUERY("toid"), "");
$delivery = ", now()";
$deliverycoll = ", dtdelivery";
}
$garminid = dlookup("select coalesce((select garminid from messages where toid=" . $toid . " order by datetime desc limit 1), 0)");
$garminid = $garminid + 1;
}
$clientid = session("client_id");
$userid = session("user_id");
$datetime = nnull(getQUERY("dt"), now());
//$datetime = now();
$subject = nnull(getQUERY("subject"), "");
$body = nnull(utf8_urldecode(getQUERY("body")), "");
$checked = '0';
RunSQL("INSERT INTO messages (fromid, toobject, toid, clientid, userid, datetime, subject, body, checked, garminid, flag" . $deliverycoll . ") \r\n\t VALUES (" . $fromid . ", '" . $toobject . "', " . $toid . ", " . $clientid . ", " . $userid . ", \r\n\t '" . $datetime . "', '" . $subject . "', '" . $body . "', " . $checked . ", " . $garminid . ", '" . $flag . "'" . $delivery . ")");
closedb();
echo $garminid;
//echo 54336;
exit;
示例5: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
$idTocki = str_replace("'", "''", NNull($_GET['selektiraniActive'], ''));
RunSQL("update pointsofinterest set active = B'1' where id in (" . $idTocki . ")");
RunSQL("INSERT INTO poiactivetimestatus(idpoi, active)\n\tSELECT cast(id as integer), '1' active\n\tFROM unnest(string_to_array('" . $idTocki . "',',')) g(id)");
closedb();
示例6: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
$idTocki = str_replace("'", "''", NNull($_GET['selektirani'], ''));
$groupid = str_replace("'", "''", NNull($_GET['groupid'], ''));
RunSQL("update pointsofinterest set groupid = " . $groupid . " where id in (" . $idTocki . ")");
closedb();
示例7: genInstallationProcessPage
function genInstallationProcessPage($sErrorMessage = '')
{
global $aConf, $confFirst, $aDbConf, $aGeneral;
$sAdminName = get_magic_quotes_gpc() ? stripslashes($_REQUEST['admin_username']) : $_REQUEST['admin_username'];
$sAdminPassword = get_magic_quotes_gpc() ? stripslashes($_REQUEST['admin_password']) : $_REQUEST['admin_password'];
$resRunSQL = RunSQL($sAdminName, $sAdminPassword);
$sForm = '';
if ('done' == $resRunSQL) {
$sForm = '
<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
<input type="submit" value="Next" class="bx-btn bx-btn-primary" />
<input type="hidden" name="action" value="step5" />
</form>';
} else {
$sForm = $resRunSQL . '
<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
<input type="submit" value="Back" class="bx-btn" />';
foreach ($_POST as $sKey => $sValue) {
if ($sKey != "action") {
$sForm .= '<input type="hidden" name="' . $sKey . '" value="' . $sValue . '" />';
}
}
$sForm .= '<input type="hidden" name="action" value="step2" />
</form>';
return $sForm;
}
foreach ($confFirst as $key => $val) {
$aConf['headerTempl'] = str_replace("%{$key}%", $_POST[$key], $aConf['headerTempl']);
}
foreach ($aDbConf as $key => $val) {
$aConf['headerTempl'] = str_replace("%{$key}%", $_POST[$key], $aConf['headerTempl']);
}
foreach ($aGeneral as $key => $val) {
$aConf['headerTempl'] = str_replace("%{$key}%", $_POST[$key], $aConf['headerTempl']);
}
$aConf['periodicTempl'] = str_replace("%site_email%", $_POST['site_email'], $aConf['periodicTempl']);
$aConf['periodicTempl'] = str_replace("%dir_root%", $_POST['dir_root'], $aConf['periodicTempl']);
$aConf['periodicTempl'] = str_replace("%dir_php%", $_POST['dir_php'], $aConf['periodicTempl']);
$sInnerCode .= "<div class=\"bx-install-debug bx-def-border bx-def-padding-sec\">{$aConf['periodicTempl']}</div>";
$fp = fopen($aConf['dolFile'], 'w');
if ($fp) {
fputs($fp, $aConf['headerTempl']);
fclose($fp);
chmod($aConf['dolFile'], 0666);
} else {
$trans = get_html_translation_table(HTML_ENTITIES);
$templ = strtr($aConf['headerTempl'], $trans);
$text = 'Warning!!! can not get write access to config file ' . $aConf['dolFile'] . '. Please save config file below manually:</font><br>';
$sInnerCode .= '<div class="bx-def-margin-top">';
$sInnerCode .= printInstallError($text);
$sInnerCode .= '<textarea cols="20" rows="10" class="headerTextarea bx-def-font bx-def-round-corners-with-border">' . $aConf['headerTempl'] . '</textarea>';
$sInnerCode .= '</div>';
}
return <<<EOF
<div class="bx-install-header-caption bx-def-font-h1 bx-def-margin-bottom">
Cron Jobs
</div>
<div class="bx-install-header-text bx-def-font-large bx-def-font-grayed bx-def-margin-bottom">
Setup Cron Jobs as specified below. Helpful info about Cron Jobs is <a href="http://www.boonex.com/trac/dolphin/wiki/DetailedInstall#InstallScript-Step5-CronJobs" target="_blank">available here</a>.
</div>
{$sInnerCode}
<div class="bx-install-buttons bx-def-margin-top">
{$sForm}
</div>
EOF;
}
示例8: set_time_limit
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
set_time_limit(0);
opendb();
$directionname = nnull(utf8_urldecode(getQUERY('directionname')), "");
$startgoogleaddress = nnull(utf8_urldecode(getQUERY('startgoogleaddress')), "");
$startgeocodeaddress = nnull(utf8_urldecode(getQUERY('startgeocodeaddress')), "");
$startlongitude = getQUERY("startlongitude");
$startlatitude = getQUERY("startlatitude");
$endgoogleaddress = nnull(utf8_urldecode(getQUERY('endgoogleaddress')), "");
$endgeocodeaddress = nnull(utf8_urldecode(getQUERY('endgeocodeaddress')), "");
$endlongitude = getQUERY("endlongitude");
$endlatitude = getQUERY("endlatitude");
$shortlineid = getQUERY('shortlineid');
$fastlineid = getQUERY('fastlineid');
$sqlAddDirection = "insert into directions (userid, clientid, directionname, startgoogleaddress, startgeocodeaddress, \r\n startlongitude, startlatitude, endgoogleaddress, endgeocodeaddress, \r\n endlongitude, endlatitude, shortlineid, fastlineid) values";
$sqlAddDirection .= "(" . session("user_id") . ", " . session("client_id") . ", '" . $directionname . "'";
$sqlAddDirection .= ",'" . $startgoogleaddress . "', '" . $startgeocodeaddress . "', " . $startlongitude;
$sqlAddDirection .= "," . $startlatitude . ", '" . $endgoogleaddress . "', '" . $endgeocodeaddress . "'";
$sqlAddDirection .= "," . $endlongitude . ", " . $endlatitude . ", " . $shortlineid . ", " . $fastlineid . ")";
//echo $sqlAddDirection;
$retID = RunSQL($sqlAddDirection);
echo $retID;
closedb();
exit;
示例9: getQUERY
$per = getQUERY("per");
$day = getQUERY("day");
$date1 = getQUERY("date1");
$saati = getQUERY("saati");
$email = getQUERY("email");
$uid = getQUERY("uid");
$path = getQUERY("path");
$doctype = getQUERY("doctype");
$Today = DateTimeFormat(now(), "Y-m-d H:i:s");
opendb();
$vehID = nnull(dlookup("select id from vehicles where registration = '" . $veh . "'"), 0);
$dayInsert = "";
if ($per == "Weekly") {
$dayInsert = $day;
}
if ($per == "Daily") {
$dayInsert = "";
}
if ($per == "Monthly") {
$dayInsert = $date1;
}
$time = $saati . ":00";
/* echo "insert into Scheduler (clientID, userID, report, vehicle, period, day, time, email,
subusers, range, vehID, path, CreationDate) values(" . Session("client_id") . "," . $uid . ",
'" . $rep . "','" . $veh . "','" . $per . "','" . $dayInsert . "','" . $time . "','" . $email . "','',
'" . $range . "', '" . $vehID . "', '" . $path . "', '" . $Today . "');";
*/
RunSQL("delete from Scheduler where clientID = " . Session("client_id") . " and userID = " . $uid . " and report = '" . $rep . "' and vehicle = '" . $veh . "' and period = '" . $per . "' and day = '" . $dayInsert . "' and time = '" . $time . "' and email = '" . $email . "'");
$ret = DlookUP("insert into Scheduler (clientID, userID, report, vehicle, period, day, time, email, subusers, range, \r\n vehID, path, CreationDate, doctype) values(" . Session("client_id") . "," . $uid . ",\r\n '" . $rep . "','" . $veh . "','" . $per . "','" . $dayInsert . "','" . $time . "','" . $email . "','', \r\n '" . $range . "', '" . $vehID . "', '" . $path . "', '" . $Today . "', '" . $doctype . "') ");
closedb();
echo $ret;
示例10: session_start
?>
<?php
session_start();
header("Content-type: text/html; charset=utf-8");
?>
<?php
$vehID = getQUERY("vehID");
$dt = DateTimeFormat(getQUERY("dt"), 'Y-m-d H:i:s');
$driver = nnull(getQUERY("driver"), "");
$km = getQUERY("km");
$loc = getQUERY("loc");
$liters = nnull(getQUERY("liters"), 0);
$litersLast = nnull(getQUERY("litersLast"), 0);
$price = nnull(getQUERY("price"), 0);
$pay = getQUERY("pay");
opendb();
$checkCnt = dlookup("select count(*) from fuel where vehicleid=" . $vehID . " and datetime = '" . $dt . "' and driverid=" . $driver . "\r\n\tand km = " . $km . " and price = " . $price . " and liters = " . $liters . " and literslast = " . $litersLast . " and pay = '" . $pay . "' and location = '" . $loc . "'");
if ($checkCnt == 0) {
if ($driver == "") {
RunSQL("INSERT INTO fuel (vehicleid, datetime, km, price, liters, literslast, pay, location) \r\n\t\t VALUES (" . $vehID . ", '" . DateTimeFormat($dt, "Y-m-d H:i:s") . "', " . $km . ", " . $price . ", " . $liters . ", \r\n\t\t " . $litersLast . ", '" . $pay . "','" . $loc . "')");
} else {
RunSQL("INSERT INTO fuel (vehicleid, datetime, driverid, km, price, liters, literslast, pay, location) \r\n\t\t VALUES (" . $vehID . ", '" . DateTimeFormat($dt, "Y-m-d H:i:s") . "', " . $driver . ", " . $km . ", " . $price . ", " . $liters . ", \r\n\t\t " . $litersLast . ", '" . $pay . "', '" . $loc . "')");
}
echo 1;
} else {
echo 0;
}
closedb();
exit;
示例11: session_start
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
session_start();
header("Expires: Mon, 20 Jul 2000 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);
header("Pragma: no-cache");
set_time_limit(0);
opendb();
$_idx = str_replace("'", "''", NNull($_GET['idx'], ''));
$p = str_replace("'", "''", NNull($_GET['points'], ''));
$_ida = str_replace("'", "''", NNull($_GET['ida'], ''));
RunSQL("insert into addareatemp(pointsofinterestid, areapoints, index, clientid) values('" . $_ida . "', '" . $p . "', '" . $_idx . "', '" . Session("client_id") . "')");
/*$tmpPoint = dlookup("select ST_AsText(geom) from pointsofinterest where id=".$_ida);
$tmp3 = strripos($tmpPoint, ",");
$tmpPointNew = substr($tmpPoint, 0, $tmp3).",".$p.substr($tmpPoint, $tmp3, strlen($tmpPoint));
echo $tmpPointNew;
RunSQL("update pointsofinterest set geom = ST_PolygonFromText('" . $tmpPointNew . "') where id=75845");
*/
//POLYGON((42.003263 21.395151,42.003662 21.395274,42.00345 21.396808,42.003048 21.396722,42.003172 21.395778,42.003263 21.395151,42.16 21.16,42.003263 21.395151,41.04 21.04,42 22,42.003263 21.395151,41.04 21.04,42.00 22.00,42.003263 21.395151))
//RunSQL("insert into AreaTempPoints(AreaID, AreaPoints, Idx, UserID, ClientID) values('" . $_ida . "', '" . $p . "', '" . $_idx . "', '" . session("user_id") . "', '" . Session("client_id") . "')");
closedb();
示例12: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
$id = str_replace("'", "''", NNull($_GET['id1'], ''));
$name = str_replace("'", "''", NNull($_GET['GroupName'], ''));
$color = str_replace("'", "''", NNull($_GET['ColorName'], ''));
$image = str_replace("'", "''", NNull($_GET['image'], '0'));
echo "update pointsofinterestgroups set fillcolor = '" . $color . "', name ='" . $name . "', strokecolor = '#000000', image = " . (int) $image . " where id = '" . $id . "' and clientid =" . Session("client_id");
RunSQL("update pointsofinterestgroups set fillcolor = '" . $color . "', name ='" . $name . "', strokecolor = '#000000', image = " . (int) $image . " where id = '" . $id . "' and clientid =" . Session("client_id"));
closedb();
示例13: getQUERY
$km = getQUERY("km");
$type = getQUERY("type");
$loc = getQUERY("loc");
$desc = getQUERY("desc");
$comp = getQUERY("comp");
$price = getQUERY("price");
$pay = getQUERY("pay");
if (is_numeric($km) == false) {
$km = "0";
}
if (is_numeric($price) == false) {
$price = "0";
}
if ($type == 0) {
$type = "Associate";
} else {
$type = "Regular";
}
opendb();
$checkCnt = dlookup("select count(*) from service where clientid=" . Session("client_id") . " and datetime='" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "' \r\n\tand vehicleid=" . $veh . " and location='" . $loc . "' and userid=" . Session("user_id") . " and type='" . $type . "' and description='" . $desc . "' \r\n\tand components='" . $comp . "' and price=" . intval($price) . " and km=" . intval($km) . " and pay='" . $pay . "' and driverid=" . $driver);
if ($checkCnt == 0) {
if ($driver == "") {
RunSQL("INSERT INTO service (clientid, datetime, vehicleid, location, userid, type, description, components, price, km, pay) \r\n\t\t VALUES (" . Session("client_id") . ", '" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "', " . $veh . ", '" . $loc . "', " . Session("user_id") . ", \r\n\t\t '" . $type . "', '" . $desc . "', '" . $comp . "', " . intval($price) . ", " . intval($km) . ", '" . $pay . "')");
} else {
RunSQL("INSERT INTO service (clientid, datetime, driverid, vehicleid, location, userid, type, description, components, price, km, pay) \r\n\t\t VALUES (" . Session("client_id") . ", '" . DateTimeFormat($datetime, "Y-m-d H:i:s") . "', " . $driver . ", " . $veh . ", '" . $loc . "', " . Session("user_id") . ", \r\n\t\t '" . $type . "', '" . $desc . "', '" . $comp . "', " . intval($price) . ", " . intval($km) . ", '" . $pay . "')");
}
echo 1;
} else {
echo 0;
}
closedb();
示例14: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
$id = str_replace("'", "''", NNull($_GET['id1'], ''));
$groupid = str_replace("'", "''", NNull($_GET['groupidVtoro'], ''));
RunSQL("update pointsofinterest set groupid = '" . $groupid . "' where id = '" . $id . "' and clientid =" . Session("client_id"));
closedb();
示例15: session_start
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
session_start();
$userID = getQUERY("uid");
$lista = getQUERY("lista");
$lista1 = explode(",", $lista);
$list1 = '';
for ($i = 0; $i < sizeof($lista1); $i++) {
$list1 = $list1 . "'1'";
if ($i < sizeof($lista1) - 1) {
$list1 = $list1 . ',';
}
}
opendb();
RunSQL("delete from privilegessettings where userID = " . $userID);
RunSQL("insert into privilegessettings (userid," . $lista . ") values (" . $userID . "," . $list1 . ")");
print "Ok";
closedb();