本文整理汇总了PHP中RunQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP RunQuery函数的具体用法?PHP RunQuery怎么用?PHP RunQuery使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RunQuery函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DeletePerson
function DeletePerson($iPersonID)
{
// Remove person from all groups they belonged to
$sSQL = "SELECT p2g2r_grp_ID FROM person2group2role_p2g2r WHERE p2g2r_per_ID = " . $iPersonID;
$rsAssignedGroups = RunQuery($sSQL);
while ($aRow = mysql_fetch_array($rsAssignedGroups)) {
extract($aRow);
RemoveFromGroup($iPersonID, $p2g2r_grp_ID);
}
// Remove custom field data
$sSQL = "DELETE FROM person_custom WHERE per_ID = " . $iPersonID;
RunQuery($sSQL);
// Remove note data
$sSQL = "DELETE FROM note_nte WHERE nte_per_ID = " . $iPersonID;
RunQuery($sSQL);
// Delete the Person record
$sSQL = "DELETE FROM person_per WHERE per_ID = " . $iPersonID;
RunQuery($sSQL);
// Remove person property data
$sSQL = "SELECT pro_ID FROM property_pro WHERE pro_Class='p'";
$rsProps = RunQuery($sSQL);
while ($aRow = mysql_fetch_row($rsProps)) {
$sSQL = "DELETE FROM record2property_r2p WHERE r2p_pro_ID = " . $aRow[0] . " AND r2p_record_ID = " . $iPersonID;
RunQuery($sSQL);
}
// Delete any User record
// $sSQL = "DELETE FROM user_usr WHERE usr_per_ID = " . $iPersonID;
// RunQuery($sSQL);
// Make sure person was not in the cart
RemoveFromPeopleCart($iPersonID);
}
示例2: GenerateLabels
function GenerateLabels(&$pdf, $mode, $bOnlyComplete = false)
{
if ($mode == "indiv") {
$sSQL = "SELECT * FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN (" . ConvertCartToString($_SESSION['aPeopleCart']) . ") ORDER BY per_LastName";
} else {
$sSQL = "(SELECT *, 0 AS memberCount FROM person_per LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID = 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ))\n\t\tUNION (SELECT *, COUNT(*) AS memberCount FROM person_per LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID > 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ) GROUP BY per_fam_ID HAVING memberCount = 1)\n\t\tUNION (SELECT *, COUNT(*) AS memberCount FROM person_per LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID > 0 AND per_ID in ( " . ConvertCartToString($_SESSION['aPeopleCart']) . " ) GROUP BY per_fam_ID HAVING memberCount > 1)";
}
$rsCartItems = RunQuery($sSQL);
while ($aRow = mysql_fetch_array($rsCartItems)) {
$sRowClass = AlternateRowStyle($sRowClass);
if ($aRow['memberCount'] > 1 && $mode == "fam") {
$sName = $aRow['fam_Name'] . " Family";
} else {
$sName = FormatFullName($aRow['per_Title'], $aRow['per_FirstName'], "", $aRow['per_LastName'], $aRow['per_Suffix'], 1);
}
SelectWhichAddress($sAddress1, $sAddress2, $aRow['per_Address1'], $aRow['per_Address2'], $aRow['fam_Address1'], $aRow['fam_Address2'], false);
$sCity = SelectWhichInfo($aRow['per_City'], $aRow['fam_City'], False);
$sState = SelectWhichInfo($aRow['per_State'], $aRow['fam_State'], False);
$sZip = SelectWhichInfo($aRow['per_Zip'], $aRow['fam_Zip'], False);
$sAddress = $sAddress1;
if ($sAddress2 != "") {
$sAddress .= "\n" . $sAddress2;
}
if (!$bOnlyComplete || strlen($sAddress) && strlen($sCity) && strlen($sState) && strlen($sZip)) {
$pdf->Add_PDF_Label(sprintf("%s\n%s\n%s, %s %s", $sName, $sAddress, $sCity, $sState, $sZip));
}
}
}
示例3: TranslateMenuOptions
function TranslateMenuOptions()
{
foreach (array('Main', 'Log Off', 'Change My Password', 'Change My Settings', 'Admin', 'Edit Users', 'Add New User', 'Edit Custom Person Fields', 'Edit Donation Funds', 'Backup Database', 'CSV Import', 'Access report', 'Edit General Settings', 'Edit Report Settings', 'Edit User Default Settings', 'Envelope Manager', 'Please select this option to register ChurchInfo after configuring.', 'People/Families', 'Add New Person', 'View All Persons', 'Classification Manager', '---------------------------', 'Edit volunteer opportunities', 'Add New Family', 'View All Families', 'Family Geographic Utilties', 'Family Map', 'Family Roles Manager', 'Events', 'List Church Events', 'Add Church Event', 'List Event Types', 'Check-in and Check-out', 'Deposit', 'Create New Deposit', 'View All Deposits', 'Deposit Reports', 'Edit Deposit Slip', 'Cart', 'List Cart Items', 'Empty Cart', 'Empty Cart to Group', 'Empty Cart to Family', 'Empty Cart to Event', 'Data/Reports', 'CSV Export Records', 'Query Menu', 'Reports Menu', 'Groups', 'List Groups', 'Add a New Group', 'Edit Group Types', 'Group Assignment Helper', 'Properties', 'People Properties', 'Family Properties', 'Group Properties', 'Property Types', 'Help', 'About ChurchInfo', 'Wiki Documentation', 'People', 'Families', 'Geographic features', 'Groups', 'Finances', 'Reports', 'Administration', 'Cart', 'Properties', 'Notes', 'Custom Fields', 'Classifications', 'Canvass Support', 'Events', 'Menu Options', 'Edit Custom Family Fields') as $str) {
$sSQL = "update menuconfig_mcf set content='" . gettext($str) . "' where content_english='" . $str . "'";
RunQuery($sSQL);
}
}
示例4: EnvelopeAssignAllFamilies
function EnvelopeAssignAllFamilies($bMembersOnly)
{
$sSQL = "SELECT per_fam_ID, per_LastName FROM person_per";
if ($bMembersOnly) {
$sSQL .= " WHERE per_cls_ID=" . FindMemberClassID();
}
$sSQL .= " ORDER BY per_LastName";
$rsPeople = RunQuery($sSQL);
$ind = 0;
$famArr = array();
while ($aRow = mysql_fetch_array($rsPeople)) {
extract($aRow);
$famArr[$ind++] = $per_fam_ID;
}
$famUnique = array_unique($famArr);
$envelopeNo = 1;
foreach ($famUnique as $oneFam) {
$sSQL = "UPDATE family_fam SET fam_Envelope='" . $envelopeNo++ . "' WHERE fam_ID='" . $oneFam . "';";
RunQuery($sSQL);
}
if ($bMembersOnly) {
return gettext("Assigned envelope numbers to all families with at least one member.");
} else {
return gettext("Assigned envelope numbers to all families.");
}
}
示例5: insertledgerlogitem
function insertledgerlogitem($lliLedgerlogID, $lliLedgerID, $lliAmount)
{
$ledgerlogitemID = uniqid('1');
$sql = "INSERT INTO ledgerlogitem(ledgerlogitemID,lliLedgerID, lliLedgerlogID,lliAmount) VALUES ";
$sql .= "('{$ledgerlogitemID}','{$lliLedgerID}','{$lliLedgerlogID}',0{$lliAmount})";
RunQuery($sql);
}
示例6: getNext
public function getNext()
{
global $config;
if (!$this->result) {
return FALSE;
}
$row = mysql_fetch_assoc($this->result);
if (!$row) {
return FALSE;
}
if ($this->result) {
$query = "SELECT AVG(price) AS MarketPrice FROM `" . $config['table prefix'] . "LogSales` WHERE " . "`itemId` = " . (int) $row['itemId'] . " AND " . "`itemDamage` = " . (int) $row['itemDamage'] . " AND " . "IFNULL (`enchantments`, '') = '" . mysql_san($row['enchantments']) . "' AND " . "`logType` = 'sale'" . "ORDER BY `id` DESC LIMIT 10";
$this->result_price = RunQuery($query, __FILE__, __LINE__);
}
if ($this->result_price) {
$row_price = mysql_fetch_assoc($this->result_price);
if ($row_price) {
$marketPrice = $row_price['MarketPrice'];
$marketPrice_total = $marketPrice * $row['qty'];
} else {
$marketPrice = "--";
$marketPrice_total = "--";
}
}
// new item dao
return new ItemDAO($row['id'], $row['itemId'], $row['itemDamage'], $row['itemData'], $row['qty'], FormatPrice($marketPrice), FormatPrice($marketPrice_total), $row['enchantments']);
}
示例7: FamilyInfoByDistance
function FamilyInfoByDistance($iFamily)
{
// Handle the degenerate case of no family selected by just making the array without
// distance and bearing data, and don't bother to sort it.
if ($iFamily) {
// Get info for the selected family
$sSQL = "SELECT fam_ID as selected_fam_ID, fam_Name as selected_fam_Name, fam_Address1 as selected_fam_Address1, fam_City as selected_fam_City, fam_State as selected_fam_State, fam_Zip as selected_fam_Zip, fam_Latitude as selected_fam_Latitude, fam_Longitude as selected_fam_Longitude from family_fam WHERE fam_ID=" . $iFamily;
$rsFamilies = RunQuery($sSQL);
extract(mysql_fetch_array($rsFamilies));
}
// Compute distance and bearing from the selected family to all other families
$sSQL = "SELECT fam_ID, fam_Name, fam_Address1, fam_City, fam_State, fam_Zip, fam_Latitude, fam_Longitude from family_fam";
$rsFamilies = RunQuery($sSQL);
while ($aFam = mysql_fetch_array($rsFamilies)) {
extract($aFam);
if ($iFamily) {
$results[$fam_ID]["Distance"] = floatval(LatLonDistance($selected_fam_Latitude, $selected_fam_Longitude, $fam_Latitude, $fam_Longitude));
$results[$fam_ID]["Bearing"] = LatLonBearing($selected_fam_Latitude, $selected_fam_Longitude, $fam_Latitude, $fam_Longitude);
}
$results[$fam_ID]["fam_Name"] = $fam_Name;
$results[$fam_ID]["fam_Address1"] = $fam_Address1;
$results[$fam_ID]["fam_City"] = $fam_City;
$results[$fam_ID]["fam_State"] = $fam_State;
$results[$fam_ID]["fam_Zip"] = $fam_Zip;
$results[$fam_ID]["fam_Latitude"] = $fam_Latitude;
$results[$fam_ID]["fam_Longitude"] = $fam_Longitude;
$results[$fam_ID]["fam_ID"] = $fam_ID;
}
if ($iFamily) {
$resultsByDistance = SortByDistance($results);
} else {
$resultsByDistance = $results;
}
return $resultsByDistance;
}
示例8: RunFreeQuery
function RunFreeQuery()
{
global $cnInfoCentral;
global $aRowClass;
global $rsQueryResults;
global $sSQL;
global $iQueryID;
//Run the SQL
$rsQueryResults = RunQuery($sSQL);
if (mysql_error() != "") {
echo gettext("An error occured: ") . mysql_errno() . "--" . mysql_error();
} else {
$sRowClass = "RowColorA";
echo "<table align=\"center\" cellpadding=\"5\" cellspacing=\"0\">";
echo "<tr class=\"" . $sRowClass . "\">";
//Loop through the fields and write the header row
for ($iCount = 0; $iCount < mysql_num_fields($rsQueryResults); $iCount++) {
echo "<td align=\"center\"><b>" . mysql_field_name($rsQueryResults, $iCount) . "</b></td>";
}
echo "</tr>";
//Loop through the recordsert
while ($aRow = mysql_fetch_array($rsQueryResults)) {
$sRowClass = AlternateRowStyle($sRowClass);
echo "<tr class=\"" . $sRowClass . "\">";
//Loop through the fields and write each one
for ($iCount = 0; $iCount < mysql_num_fields($rsQueryResults); $iCount++) {
echo "<td align=\"center\">" . $aRow[$iCount] . "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "<br><p class=\"ShadedBox\" style=\"border-style: solid; margin-left: 50px; margin-right: 50 px; border-width: 1px;\"><span class=\"SmallText\">" . str_replace(Chr(13), "<br>", htmlspecialchars($sSQL)) . "</span></p>";
}
}
示例9: DeleteTableBackup
function DeleteTableBackup($tn)
{
$sSQL = "DROP TABLE IF EXISTS {$tn}" . "_backup";
if (!RunQuery($sSQL, FALSE)) {
return false;
}
return true;
}
示例10: addLog
public static function addLog($logType, $saleType, $sellerName, $buyerName, $Item, $price, $allowBids, $currentWinner, $alert = 0)
{
global $config;
$query = "INSERT INTO `" . $config['table prefix'] . "LogSales` ( " . "`logType`, `saleType`, `timestamp`, `itemType`, `itemId`, `itemDamage`, `itemTitle`, `enchantments`, `seller`, `buyer`, `qty`, `price`, `alert` ) VALUES ( " . ($logType == self::LOG_NEW || $logType == self::LOG_SALE || $logType == self::LOG_CANCEL ? "'" . mysql_san($logType) . "'" : 'NULL') . ", " . ($saleType == self::SALE_BUYNOW || $saleType == self::SALE_AUCTION ? "'" . mysql_san($saleType) . "'" : 'NULL') . ", " . "NOW(), " . "'" . mysql_san($Item->getItemType()) . "', " . (int) $Item->getItemId() . ", " . (int) $Item->getItemDamage() . ", " . "'" . mysql_san($Item->getItemTitle()) . "', " . "'" . mysql_san($Item->getEnchantmentsCompressed()) . "', " . ($sellerName == NULL ? 'NULL' : "'" . mysql_san($sellerName) . "'") . ", " . ($buyerName == NULL ? 'NULL' : "'" . mysql_san($buyerName) . "'") . ", " . (int) $Item->getItemQty() . ", " . (double) $price . ", " . (int) $alert . " )";
$result = RunQuery($query, __FILE__, __LINE__);
if (!$result || mysql_affected_rows() == 0) {
echo '<p style="color: red;">Error logging sale!</p>';
exit;
}
}
示例11: doQuery
protected function doQuery($WHERE)
{
global $config;
if (empty($WHERE)) {
$this->result = FALSE;
return;
}
$query = "SELECT `id`, `itemId`, `itemDamage`, `qty`, `enchantments` " . "FROM `" . $config['table prefix'] . "Items` " . "WHERE " . $WHERE . " ORDER BY `id` ASC";
$this->result = RunQuery($query, __FILE__, __LINE__);
}
示例12: TranslateMenuOptions
function TranslateMenuOptions()
{
$sSQL = "SELECT content_english from menuconfig_mcf";
$rsMenuOptions = RunQuery($sSQL);
while ($myrow = mysql_fetch_row($rsMenuOptions)) {
$optStr = $myrow[0];
$sSQL = "update menuconfig_mcf set content='" . gettext($optStr) . "' where content_english='" . $optStr . "'";
RunQuery($sSQL);
}
}
示例13: AdjustOrder
function AdjustOrder($sAdjParent, $iDelOrder)
{
$sSQL = "SELECT mid, sortorder FROM menuconfig_mcf WHERE parent = '{$sAdjParent}' AND sortorder > {$iDelOrder} ORDER BY sortorder";
$rsTemp = RunQuery($sSQL);
while ($aRow = mysql_fetch_array($rsTemp)) {
extract($aRow);
$sSQL = "UPDATE menuconfig_mcf SET sortorder = ({$sortorder} - 1) WHERE mid = {$mid}";
RunQuery($sSQL);
}
}
示例14: MakeSalutationUtility
function MakeSalutationUtility($famID)
{
// Make it put the name if there is only one individual in the family
// Make it put two first names and the last name when there are exactly two people in the family (e.g. "Nathaniel and Jeanette Brooks")
// Make it put two whole names where there are exactly two people with different names (e.g. "Doug Philbrook and Karen Andrews")
// When there are more than two people in the family I don't have any way to know which people are children, so I would have to just use the family name (e.g. "Grossman Family").
$sSQL = "SELECT * FROM family_fam WHERE fam_ID=" . $famID;
$rsFamInfo = RunQuery($sSQL);
if (mysql_num_rows($rsFamInfo) == 0) {
return "Invalid Family" . $famID;
}
$aFam = mysql_fetch_array($rsFamInfo);
extract($aFam);
$sSQL = "SELECT * FROM person_per WHERE per_fam_ID=" . $famID . " ORDER BY per_fmr_ID";
$rsMembers = RunQuery($sSQL);
$numMembers = mysql_num_rows($rsMembers);
$numChildren = 0;
$indNotChild = 0;
for ($ind = 0; $ind < $numMembers; $ind++) {
$member = mysql_fetch_array($rsMembers);
extract($member);
if ($per_fmr_ID == 3) {
$numChildren++;
} else {
$aNotChildren[$indNotChild++] = $member;
}
}
$numNotChildren = $numMembers - $numChildren;
if ($numNotChildren == 1) {
extract($aNotChildren[0]);
return $per_FirstName . " " . $per_LastName;
} else {
if ($numNotChildren == 2) {
$firstMember = mysql_fetch_array($rsMembers);
extract($aNotChildren[0]);
$firstFirstName = $per_FirstName;
$firstLastName = $per_LastName;
$secondMember = mysql_fetch_array($rsMembers);
extract($aNotChildren[1]);
$secondFirstName = $per_FirstName;
$secondLastName = $per_LastName;
if ($firstLastName == $secondLastName) {
return $firstFirstName . " & " . $secondFirstName . " " . $firstLastName;
} else {
return $firstFirstName . " " . $firstLastName . " & " . $secondFirstName . " " . $secondLastName;
}
} else {
return $fam_Name . " Family";
}
}
}
示例15: GetGroupArray
function GetGroupArray($iGroupID)
{
//Get the Properties assigned to this Group
$sSQL = "SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID\n\t\t FROM record2property_r2p\n\t\t LEFT JOIN property_pro ON pro_ID = r2p_pro_ID\n\t\t LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID\n\t\t WHERE pro_Class = 'g' AND r2p_record_ID = " . $iGroupID . " ORDER BY prt_Name, pro_Name";
$rsAssignedProperties = RunQuery($sSQL);
// Get the group's role list ID
$sSQL = "SELECT grp_RoleListID,grp_hasSpecialProps FROM group_grp WHERE grp_ID =" . $iGroupID;
$aTemp = mysql_fetch_array(RunQuery($sSQL));
$iRoleListID = $aTemp[0];
$bHasSpecialProps = $aTemp[1] == "true";
// Get the roles
$sSQL = "SELECT * FROM list_lst WHERE lst_ID = " . $iRoleListID . " ORDER BY lst_OptionSequence";
$rsRoles = RunQuery($sSQL);
$numRoles = mysql_num_rows($rsRoles);
// Get the members of the groups along with their family data
$sSQL = "SELECT per_ID, per_FirstName, per_MiddleName, per_LastName, per_Title, \n per_Suffix, per_Address1, per_Address2, per_City, per_State, \n per_Zip, per_HomePhone, per_Country, per_Email, per_BirthMonth, per_BirthDay, per_BirthYear, \n fam_ID, fam_Address1, fam_Address2, fam_City, fam_State, fam_Zip, fam_Country, fam_HomePhone, \n fam_Email, lst_OptionName\n\t\t\t FROM person_per\n\t\t\t LEFT JOIN person2group2role_p2g2r ON per_ID = p2g2r_per_ID\n\t\t\t LEFT JOIN list_lst ON p2g2r_rle_ID = lst_OptionID AND lst_ID = {$iRoleListID}\n\t\t\t LEFT JOIN group_grp ON grp_ID = p2g2r_grp_ID\n\t\t\t LEFT JOIN family_fam ON per_fam_ID = family_fam.fam_ID\n\t\t WHERE p2g2r_grp_ID = " . $iGroupID . " ORDER BY per_LastName, per_FirstName";
$rsGroupMembers = RunQuery($sSQL);
$row = 0;
while ($aGroupMember = mysql_fetch_array($rsGroupMembers)) {
$ret[$row++] = $aGroupMember;
}
return $ret;
}