当前位置: 首页>>代码示例>>PHP>>正文


PHP convert_string_to_sqlsyntax函数代码示例

本文整理汇总了PHP中convert_string_to_sqlsyntax函数的典型用法代码示例。如果您正苦于以下问题:PHP convert_string_to_sqlsyntax函数的具体用法?PHP convert_string_to_sqlsyntax怎么用?PHP convert_string_to_sqlsyntax使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了convert_string_to_sqlsyntax函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_similar_terms

function get_similar_terms($lang_id, $compared_term, $max_count, $min_ranking)
{
    // For a language $lang_id and a term $compared_term (UTF-8),
    // return an array with $max_count wordids with a similarity ranking
    // > $min_ranking, sorted decending.
    // If string is already in database, it will be excluded in results.
    global $tbpref;
    $compared_term_lc = mb_strtolower($compared_term, 'UTF-8');
    $sql = "select WoID, WoTextLC from " . $tbpref . "words where WoLgID = " . $lang_id . " AND WoTextLC <> " . convert_string_to_sqlsyntax($compared_term_lc);
    $res = do_mysql_query($sql);
    $termlsd = array();
    while ($record = mysql_fetch_assoc($res)) {
        $termlsd[$record["WoID"]] = getSimilarityRanking($compared_term_lc, $record["WoTextLC"]);
    }
    mysql_free_result($res);
    arsort($termlsd, SORT_NUMERIC);
    $r = array();
    $i = 0;
    foreach ($termlsd as $key => $val) {
        if ($i >= $max_count) {
            break;
        }
        if ($val < $min_ranking) {
            break;
        }
        $i++;
        $r[$i] = $key;
    }
    return $r;
}
开发者ID:Fips11,项目名称:lwt,代码行数:30,代码来源:simterms.inc.php

示例2: savetag

function savetag($item, $key, $wid)
{
    global $tbpref;
    if (!in_array($item, $_SESSION['TAGS'])) {
        runsql('insert into ' . $tbpref . 'tags (TgText) values(' . convert_string_to_sqlsyntax($item) . ')', "");
        get_tags($refresh = 1);
    }
    runsql('insert ignore into ' . $tbpref . 'wordtags (WtWoID, WtTgID) select ' . $wid . ', TgID from ' . $tbpref . 'tags where TgText = ' . convert_string_to_sqlsyntax($item), "");
}
开发者ID:Fips11,项目名称:lwt,代码行数:9,代码来源:upload_words.php

示例3: Known

Setting all unknown words to Well Known (99)
***************************************************************/
require_once 'settings.inc.php';
require_once 'connect.inc.php';
require_once 'dbutils.inc.php';
require_once 'utilities.inc.php';
$langid = get_first_value("select TxLgID as value from " . $tbpref . "texts where TxID = " . $_REQUEST['text']);
pagestart("Setting all blue words to Well-known", false);
$sql = 'select distinct TiText, TiTextLC from (' . $tbpref . 'textitems left join ' . $tbpref . 'words on (TiTextLC = WoTextLC) and (TiLgID = WoLgID)) where TiIsNotWord = 0 and WoID is null and TiWordCount = 1 and TiTxID = ' . $_REQUEST['text'] . ' order by TiOrder';
$res = do_mysql_query($sql);
$count = 0;
$javascript = "var title='';";
while ($record = mysql_fetch_assoc($res)) {
    $term = $record['TiText'];
    $termlc = $record['TiTextLC'];
    $count1 = 0 + runsql('insert into ' . $tbpref . 'words (WoLgID, WoText, WoTextLC, WoStatus, WoStatusChanged,' . make_score_random_insert_update('iv') . ') values( ' . $langid . ', ' . convert_string_to_sqlsyntax($term) . ', ' . convert_string_to_sqlsyntax($termlc) . ', 99 , NOW(), ' . make_score_random_insert_update('id') . ')', '');
    $wid = get_last_key();
    if ($count1 > 0) {
        $javascript .= "title = make_tooltip(" . prepare_textdata_js($term) . ",'*','','99');";
    }
    $javascript .= "\$('.TERM" . strToClassName($termlc) . "', context).removeClass('status0').addClass('status99 word" . $wid . "').attr('data_status','99').attr('data_wid','" . $wid . "').attr('title',title);";
    $count += $count1;
}
mysql_free_result($res);
echo "<p>OK, you know all " . $count . " word(s) well!</p>";
?>
<script type="text/javascript">
//<![CDATA[
var context = window.parent.frames['l'].document;
var contexth = window.parent.frames['h'].document;
<?php 
开发者ID:Fips11,项目名称:lwt,代码行数:31,代码来源:all_words_wellknown.php

示例4: runsql

    } else {
        $translation = $translation_raw;
    }
    // INSERT
    if ($_REQUEST['op'] == 'Save') {
        $message = runsql('insert into ' . $tbpref . 'words (WoLgID, WoTextLC, WoText, ' . 'WoStatus, WoTranslation, WoSentence, WoRomanization, WoStatusChanged,' . make_score_random_insert_update('iv') . ') values( ' . $_REQUEST["WoLgID"] . ', ' . convert_string_to_sqlsyntax(mb_strtolower($_REQUEST["WoText"], 'UTF-8')) . ', ' . convert_string_to_sqlsyntax($_REQUEST["WoText"]) . ', ' . $_REQUEST["WoStatus"] . ', ' . convert_string_to_sqlsyntax($translation) . ', ' . convert_string_to_sqlsyntax(repl_tab_nl($_REQUEST["WoSentence"])) . ', ' . convert_string_to_sqlsyntax($_REQUEST["WoRomanization"]) . ', NOW(), ' . make_score_random_insert_update('id') . ')', "Saved", $sqlerrdie = FALSE);
        $wid = get_last_key();
    } else {
        $oldstatus = $_REQUEST["WoOldStatus"];
        $newstatus = $_REQUEST["WoStatus"];
        $xx = '';
        if ($oldstatus != $newstatus) {
            $xx = ', WoStatus = ' . $newstatus . ', WoStatusChanged = NOW()';
        }
        $wid = $_REQUEST["WoID"] + 0;
        $message = runsql('update ' . $tbpref . 'words set WoText = ' . convert_string_to_sqlsyntax($_REQUEST["WoText"]) . ', WoTextLC = ' . convert_string_to_sqlsyntax(mb_strtolower($_REQUEST["WoText"], 'UTF-8')) . ', WoTranslation = ' . convert_string_to_sqlsyntax($translation) . ', WoSentence = ' . convert_string_to_sqlsyntax(repl_tab_nl($_REQUEST["WoSentence"])) . ', WoRomanization = ' . convert_string_to_sqlsyntax($_REQUEST["WoRomanization"]) . $xx . ',' . make_score_random_insert_update('u') . ' where WoID = ' . $_REQUEST["WoID"], "Updated", $sqlerrdie = FALSE);
    }
    saveWordTags($wid);
}
// NEW
if (isset($_REQUEST['new']) && isset($_REQUEST['lang'])) {
    $scrdir = getScriptDirectionTag($_REQUEST['lang']);
    ?>

	<h4>New Term</h4>
	<script type="text/javascript" src="js/unloadformcheck.js" charset="utf-8"></script>	
	<form name="newword" class="validate" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">
	<input type="hidden" name="WoLgID" id="langfield" value="<?php 
开发者ID:MaVince,项目名称:lwt,代码行数:31,代码来源:edit_words.php

示例5: trim

if (isset($_REQUEST['op'])) {
    $textlc = trim(prepare_textdata($_REQUEST["WoTextLC"]));
    $text = trim(prepare_textdata($_REQUEST["WoText"]));
    if (mb_strtolower($text, 'UTF-8') == $textlc) {
        // UPDATE
        if ($_REQUEST['op'] == 'Change') {
            $titeltext = "Edit Term: " . tohtml(prepare_textdata($_REQUEST["WoTextLC"]));
            pagestart_nobody($titeltext);
            echo '<h4><span class="bigger">' . $titeltext . '</span></h4>';
            $oldstatus = $_REQUEST["WoOldStatus"];
            $newstatus = $_REQUEST["WoStatus"];
            $xx = '';
            if ($oldstatus != $newstatus) {
                $xx = ', WoStatus = ' . $newstatus . ', WoStatusChanged = NOW()';
            }
            $message = runsql('update words set WoText = ' . convert_string_to_sqlsyntax($_REQUEST["WoText"]) . ', WoTranslation = ' . convert_string_to_sqlsyntax($translation) . ', WoSentence = ' . convert_string_to_sqlsyntax(repl_tab_nl($_REQUEST["WoSentence"])) . ', WoRomanization = ' . convert_string_to_sqlsyntax($_REQUEST["WoRomanization"]) . $xx . ',' . make_score_random_insert_update('u') . ' where WoID = ' . $_REQUEST["WoID"], "Updated");
            $wid = $_REQUEST["WoID"];
            saveWordTags($wid);
        }
        // $_REQUEST['op'] == 'Change'
    } else {
        // (mb_strtolower($text, 'UTF-8') != $textlc)
        $titeltext = "New/Edit Term: " . tohtml(prepare_textdata($_REQUEST["WoTextLC"]));
        pagestart_nobody($titeltext);
        echo '<h4><span class="bigger">' . $titeltext . '</span></h4>';
        $message = 'Error: Term in lowercase must be exactly = "' . $textlc . '", please go back and correct this!';
        echo error_message_with_hide($message, 0);
        pageend();
        exit;
    }
    ?>
开发者ID:russell359,项目名称:lwt,代码行数:31,代码来源:edit_tword.php

示例6: elseif

        }
    } elseif (substr($_REQUEST['op'], 0, 5) == 'Creat') {
        $langid = $_REQUEST["LgID"] + 0;
        $title = stripTheSlashesIfNeeded($_REQUEST["TxTitle"]);
        $source_uri = stripTheSlashesIfNeeded($_REQUEST["TxSourceURI"]);
        $_REQUEST["TextTags"] = json_decode(stripTheSlashesIfNeeded($_REQUEST["TextTags"]), true);
        $textcount = $_REQUEST["TextCount"] + 0;
        $texts = $_REQUEST["text"];
        if (count($texts) != $textcount) {
            $message = "Error: Number of texts wrong: " . count($texts) . " != " . $textcount;
        } else {
            $imported = 0;
            for ($i = 0; $i < $textcount; $i++) {
                $counter = makeCounterWithTotal($textcount, $i + 1);
                $thistitle = $title . ($counter == '' ? '' : ' (' . $counter . ')');
                $imported = $imported + runsql('insert into ' . $tbpref . 'texts (TxLgID, TxTitle, TxText, TxAnnotatedText, TxAudioURI, TxSourceURI) values( ' . $langid . ', ' . convert_string_to_sqlsyntax($thistitle) . ', ' . convert_string_to_sqlsyntax($texts[$i]) . ", '', NULL, " . convert_string_to_sqlsyntax($source_uri) . ')', '');
                $id = get_last_key();
                saveTextTags($id);
                splitCheckText($texts[$i], $langid, $id);
            }
        }
        $message = $imported . " Text(s) imported!";
        echo error_message_with_hide($message, 0);
        ?>
		
		<p>&nbsp;<br /><input type="button" value="Show Texts" onclick="location.href='edit_texts.php';" /></p>
<?php 
    }
} else {
    ?>
开发者ID:nahabi4,项目名称:lwt,代码行数:30,代码来源:long_text_import.php

示例7: isset

require_once 'settings.inc.php';
require_once 'connect.inc.php';
require_once 'dbutils.inc.php';
require_once 'utilities.inc.php';
$value = isset($_POST['value']) ? $_POST['value'] : "";
$value = trim($value);
$id = isset($_POST['id']) ? $_POST['id'] : "";
if (substr($id, 0, 5) == "trans") {
    $id = substr($id, 5);
    if ($value == '') {
        $value = '*';
    }
    $message = runsql('update ' . $tbpref . 'words set WoTranslation = ' . convert_string_to_sqlsyntax(repl_tab_nl($value)) . ' where WoID = ' . $id, "");
    echo get_first_value("select WoTranslation as value from " . $tbpref . "words where WoID = " . $id);
    exit;
}
if (substr($id, 0, 5) == "roman") {
    if ($value == '*') {
        $value = '';
    }
    $id = substr($id, 5);
    $message = runsql('update ' . $tbpref . 'words set WoRomanization = ' . convert_string_to_sqlsyntax(repl_tab_nl($value)) . ' where WoID = ' . $id, "");
    $value = get_first_value("select WoRomanization as value from " . $tbpref . "words where WoID = " . $id);
    if ($value == '') {
        echo '*';
    } else {
        echo $value;
    }
    exit;
}
echo "ERROR - please refresh page!";
开发者ID:Fips11,项目名称:lwt,代码行数:31,代码来源:inline_edit.php

示例8: word

unless such conditions are required by law.

Developed by J. Pierre in 2011.
***************************************************************/
/**************************************************************
Call: insert_word_wellknown.php?tid=[textid]&ord=[textpos]
Ignore single word (new term with status 99)
***************************************************************/
include "connect.inc.php";
include "settings.inc.php";
include "utilities.inc.php";
$word = get_first_value("select TiText as value from textitems where TiWordCount = 1 and TiTxID = " . $_REQUEST['tid'] . " and TiOrder = " . $_REQUEST['ord']);
$wordlc = mb_strtolower($word, 'UTF-8');
$langid = get_first_value("select TxLgID as value from texts where TxID = " . $_REQUEST['tid']);
pagestart("Term: " . $word, false);
$m1 = runsql('insert into words (WoLgID, WoText, WoTextLC, WoStatus, WoStatusChanged,' . make_score_random_insert_update('iv') . ') values( ' . $langid . ', ' . convert_string_to_sqlsyntax($word) . ', ' . convert_string_to_sqlsyntax($wordlc) . ', 99, NOW(), ' . make_score_random_insert_update('id') . ')', 'Term added');
$wid = get_last_key();
echo "<p>OK, you know this term well!</p>";
$hex = strToClassName($wordlc);
?>
<script type="text/javascript">
//<![CDATA[
var context = window.parent.frames['l'].document;
var contexth = window.parent.frames['h'].document;
var title = make_tooltip(<?php 
echo prepare_textdata_js($word);
?>
,'*','','99');
$('.TERM<?php 
echo $hex;
?>
开发者ID:hans,项目名称:lwt,代码行数:31,代码来源:insert_word_wellknown.php

示例9: savetag

function savetag($item, $key, $wid)
{
    global $tbpref;
    runsql('insert into ' . $tbpref . 'tags (TgText) values(' . convert_string_to_sqlsyntax($item) . ')', "");
    runsql('insert into ' . $tbpref . 'wordtags (WtWoID, WtTgID) select ' . $wid . ', TgID from ' . $tbpref . 'tags where TgText = ' . convert_string_to_sqlsyntax($item), "");
}
开发者ID:chajadan,项目名称:lwt,代码行数:6,代码来源:upload_words.php

示例10: getreq

$editmode = getreq('edit') + 0;
$delmode = getreq('del') + 0;
$ann = get_first_value("select TxAnnotatedText as value from " . $tbpref . "texts where TxID = " . $textid);
$ann_exists = strlen($ann) > 0;
if ($ann_exists) {
    $ann = recreate_save_ann($textid, $ann);
    $ann_exists = strlen($ann) > 0;
}
if ($textid == 0) {
    header("Location: edit_texts.php");
    exit;
}
if ($delmode) {
    // Delete
    if ($ann_exists) {
        $dummy = runsql('update ' . $tbpref . 'texts set ' . 'TxAnnotatedText = ' . convert_string_to_sqlsyntax("") . ' where TxID = ' . $textid, "");
    }
    $ann_exists = get_first_value("select length(TxAnnotatedText) as value from " . $tbpref . "texts where TxID = " . $textid) + 0 > 0;
    if (!$ann_exists) {
        header("Location: print_text.php?text=" . $textid);
        exit;
    }
}
$sql = 'select TxLgID, TxTitle, TxAudioURI, TxSourceURI from ' . $tbpref . 'texts where TxID = ' . $textid;
$res = do_mysql_query($sql);
$record = mysql_fetch_assoc($res);
$title = $record['TxTitle'];
$sourceURI = $record['TxSourceURI'];
$langid = $record['TxLgID'];
$audio = $record['TxAudioURI'];
if (!isset($audio)) {
开发者ID:nahabi4,项目名称:lwt,代码行数:31,代码来源:print_impr_text.php

示例11: splitCheckText

    } else {
        // CHECK
        if ($_REQUEST['op'] == 'Check') {
            echo '<p><input type="button" value="&lt;&lt; Back" onclick="history.back();" /></p>';
            echo splitCheckText($_REQUEST['TxText'], $_REQUEST['TxLgID'], -1);
            echo '<p><input type="button" value="&lt;&lt; Back" onclick="history.back();" /></p>';
            pageend();
            exit;
        } elseif (substr($_REQUEST['op'], 0, 4) == 'Save') {
            $message1 = runsql('insert into ' . $tbpref . 'texts (TxLgID, TxTitle, TxText, TxAnnotatedText, TxAudioURI, TxSourceURI) values( ' . $_REQUEST["TxLgID"] . ', ' . convert_string_to_sqlsyntax($_REQUEST["TxTitle"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["TxText"]) . ", '', " . convert_string_to_sqlsyntax($_REQUEST["TxAudioURI"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["TxSourceURI"]) . ')', "Saved");
            $id = get_last_key();
            saveTextTags($id);
        } elseif (substr($_REQUEST['op'], 0, 6) == 'Change') {
            $oldtext = get_first_value('select TxText as value from ' . $tbpref . 'texts where TxID = ' . $_REQUEST["TxID"]);
            $textsdiffer = convert_string_to_sqlsyntax($_REQUEST["TxText"]) != convert_string_to_sqlsyntax($oldtext);
            $message1 = runsql('update ' . $tbpref . 'texts set ' . 'TxLgID = ' . $_REQUEST["TxLgID"] . ', ' . 'TxTitle = ' . convert_string_to_sqlsyntax($_REQUEST["TxTitle"]) . ', ' . 'TxText = ' . convert_string_to_sqlsyntax($_REQUEST["TxText"]) . ', ' . 'TxAudioURI = ' . convert_string_to_sqlsyntax($_REQUEST["TxAudioURI"]) . ', ' . 'TxSourceURI = ' . convert_string_to_sqlsyntax($_REQUEST["TxSourceURI"]) . ' ' . 'where TxID = ' . $_REQUEST["TxID"], "Updated");
            $id = $_REQUEST["TxID"];
            saveTextTags($id);
        }
        $message2 = runsql('delete from ' . $tbpref . 'sentences where SeTxID = ' . $id, "Sentences deleted");
        $message3 = runsql('delete from ' . $tbpref . 'textitems where TiTxID = ' . $id, "Textitems deleted");
        adjust_autoincr('sentences', 'SeID');
        adjust_autoincr('textitems', 'TiID');
        splitCheckText(get_first_value('select TxText as value from ' . $tbpref . 'texts where TxID = ' . $id), $_REQUEST["TxLgID"], $id);
        $message = $message1 . " / " . $message2 . " / " . $message3 . " / Sentences added: " . get_first_value('select count(*) as value from ' . $tbpref . 'sentences where SeTxID = ' . $id) . " / Text items added: " . get_first_value('select count(*) as value from ' . $tbpref . 'textitems where TiTxID = ' . $id);
        if (substr($_REQUEST['op'], -8) == "and Open") {
            header('Location: do_text.php?start=' . $id);
            exit;
        }
    }
}
开发者ID:nahabi4,项目名称:lwt,代码行数:31,代码来源:edit_texts.php

示例12: getreq

 // if (! isset($_REQUEST['op']))
 // edit_word.php?tid=..&ord=..&wid=..
 $wid = getreq('wid');
 if ($wid == '') {
     $sql = 'select TiText, TiLgID from ' . $tbpref . 'textitems where TiTxID = ' . $_REQUEST['tid'] . ' and TiWordCount = 1 and TiOrder = ' . $_REQUEST['ord'];
     $res = do_mysql_query($sql);
     $record = mysql_fetch_assoc($res);
     if ($record) {
         $term = $record['TiText'];
         $lang = $record['TiLgID'];
     } else {
         my_die("Cannot access Term and Language in edit_word.php");
     }
     mysql_free_result($res);
     $termlc = mb_strtolower($term, 'UTF-8');
     $wid = get_first_value("select WoID as value from " . $tbpref . "words where WoLgID = " . $lang . " and WoTextLC = " . convert_string_to_sqlsyntax($termlc));
 } else {
     $sql = 'select WoText, WoLgID from ' . $tbpref . 'words where WoID = ' . $wid;
     $res = do_mysql_query($sql);
     $record = mysql_fetch_assoc($res);
     if ($record) {
         $term = $record['WoText'];
         $lang = $record['WoLgID'];
     } else {
         my_die("Cannot access Term and Language in edit_word.php");
     }
     mysql_free_result($res);
     $termlc = mb_strtolower($term, 'UTF-8');
 }
 $new = isset($wid) == FALSE;
 $titletext = ($new ? "New Term" : "Edit Term") . ": " . tohtml($term);
开发者ID:Fips11,项目名称:lwt,代码行数:31,代码来源:edit_word.php

示例13: refreshText

function refreshText($word, $tid)
{
    global $tbpref;
    // $word : only sentences with $word
    // $tid : textid
    // only to be used when $showAll = 0 !
    $out = '';
    $wordlc = trim(mb_strtolower($word, 'UTF-8'));
    if ($wordlc == '') {
        return '';
    }
    $sql = 'SELECT distinct TiSeID FROM ' . $tbpref . 'textitems WHERE TiIsNotWord = 0 and TiTextLC = ' . convert_string_to_sqlsyntax($wordlc) . ' and TiTxID = ' . $tid . ' order by TiSeID';
    $res = do_mysql_query($sql);
    $inlist = '(';
    while ($record = mysql_fetch_assoc($res)) {
        if ($inlist == '(') {
            $inlist .= $record['TiSeID'];
        } else {
            $inlist .= ',' . $record['TiSeID'];
        }
    }
    mysql_free_result($res);
    if ($inlist == '(') {
        return '';
    } else {
        $inlist = ' where TiSeID in ' . $inlist . ') ';
    }
    $sql = 'select TiWordCount as Code, TiOrder, TiIsNotWord, WoID from (' . $tbpref . 'textitems left join ' . $tbpref . 'words on (TiTextLC = WoTextLC) and (TiLgID = WoLgID)) ' . $inlist . ' order by TiOrder asc, TiWordCount desc';
    $res = do_mysql_query($sql);
    $hideuntil = -1;
    $hidetag = "removeClass('hide');";
    while ($record = mysql_fetch_assoc($res)) {
        // MAIN LOOP
        $actcode = $record['Code'] + 0;
        $order = $record['TiOrder'] + 0;
        $notword = $record['TiIsNotWord'] + 0;
        $termex = isset($record['WoID']);
        $spanid = 'ID-' . $order . '-' . $actcode;
        if ($hideuntil > 0) {
            if ($order <= $hideuntil) {
                $hidetag = "addClass('hide');";
            } else {
                $hideuntil = -1;
                $hidetag = "removeClass('hide');";
            }
        }
        if ($notword != 0) {
            // NOT A TERM
            $out .= "\$('#" . $spanid . "',context)." . $hidetag . "\n";
        } else {
            // A TERM
            if ($actcode > 1) {
                // A MULTIWORD FOUND
                if ($termex) {
                    // MULTIWORD FOUND - DISPLAY
                    if ($hideuntil == -1) {
                        $hideuntil = $order + ($actcode - 1) * 2;
                    }
                    $out .= "\$('#" . $spanid . "',context)." . $hidetag . "\n";
                } else {
                    // MULTIWORD PLACEHOLDER - NO DISPLAY
                    $out .= "\$('#" . $spanid . "',context).addClass('hide');\n";
                }
            } else {
                // ($actcode == 1)  -- A WORD FOUND
                $out .= "\$('#" . $spanid . "',context)." . $hidetag . "\n";
            }
        }
    }
    //  MAIN LOOP
    mysql_free_result($res);
    return $out;
}
开发者ID:shoehn,项目名称:learningwithtext,代码行数:73,代码来源:utilities.inc.php

示例14: get_first_value

if (isset($_REQUEST['del'])) {
    $anztexts = get_first_value('select count(TxID) as value from texts where TxLgID = ' . $_REQUEST['del']);
    $anzarchtexts = get_first_value('select count(AtID) as value from archivedtexts where AtLgID = ' . $_REQUEST['del']);
    $anzwords = get_first_value('select count(WoID) as value from words where WoLgID = ' . $_REQUEST['del']);
    if ($anztexts > 0 || $anzarchtexts > 0 || $anzwords > 0) {
        $message = 'You must first delete texts, archived texts and words with this language!';
    } else {
        $message = runsql('delete from languages where LgID = ' . $_REQUEST['del'], "Deleted");
        adjust_autoincr('languages', 'LgID');
    }
} elseif (isset($_REQUEST['op'])) {
    // INSERT
    if ($_REQUEST['op'] == 'Save') {
        $message = runsql('insert into languages (LgName, LgDict1URI, LgDict2URI, LgGoogleTranslateURI, LgTextSize, LgCharacterSubstitutions, LgRegexpSplitSentences, LgExceptionsSplitSentences, LgRegexpWordCharacters, LgRemoveSpaces, LgSplitEachChar, LgRightToLeft) values(' . convert_string_to_sqlsyntax($_REQUEST["LgName"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgDict1URI"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgDict2URI"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgGoogleTranslateURI"]) . ', ' . $_REQUEST["LgTextSize"] . ', ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgCharacterSubstitutions"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpSplitSentences"]) . ', ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgExceptionsSplitSentences"]) . ', ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpWordCharacters"]) . ', ' . $_REQUEST["LgRemoveSpaces"] . ', ' . $_REQUEST["LgSplitEachChar"] . ', ' . $_REQUEST["LgRightToLeft"] . ')', 'Saved');
    } elseif ($_REQUEST['op'] == 'Change') {
        $message = runsql('update languages set ' . 'LgName = ' . convert_string_to_sqlsyntax($_REQUEST["LgName"]) . ', ' . 'LgDict1URI = ' . convert_string_to_sqlsyntax($_REQUEST["LgDict1URI"]) . ', ' . 'LgDict2URI = ' . convert_string_to_sqlsyntax($_REQUEST["LgDict2URI"]) . ', ' . 'LgGoogleTranslateURI = ' . convert_string_to_sqlsyntax($_REQUEST["LgGoogleTranslateURI"]) . ', ' . 'LgTextSize = ' . $_REQUEST["LgTextSize"] . ', ' . 'LgCharacterSubstitutions = ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgCharacterSubstitutions"]) . ', ' . 'LgRegexpSplitSentences = ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpSplitSentences"]) . ', ' . 'LgExceptionsSplitSentences = ' . convert_string_to_sqlsyntax_notrim_nonull($_REQUEST["LgExceptionsSplitSentences"]) . ', ' . 'LgRegexpWordCharacters = ' . convert_string_to_sqlsyntax($_REQUEST["LgRegexpWordCharacters"]) . ', ' . 'LgRemoveSpaces = ' . $_REQUEST["LgRemoveSpaces"] . ', ' . 'LgSplitEachChar = ' . $_REQUEST["LgSplitEachChar"] . ', ' . 'LgRightToLeft = ' . $_REQUEST["LgRightToLeft"] . ' where LgID = ' . $_REQUEST["LgID"], 'Updated');
    }
}
// NEW
if (isset($_REQUEST['new'])) {
    ?>

	<h4>New Language <a target="_blank" href="info.htm#howtolang"><img src="icn/question-frame.png" title="Help" alt="Help" /></a> </h4>
	<form class="validate" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">
	<table class="tab3" cellspacing="0" cellpadding="5">
	<tr>
	<td class="td1 right">Language:</td>
	<td class="td1"><input type="text" class="notempty setfocus" name="LgName" value="" maxlength="40" size="40" /> <img src="icn/status-busy.png" title="Field must not be empty" alt="Field must not be empty" /></td>
开发者ID:hans,项目名称:lwt,代码行数:31,代码来源:edit_languages.php

示例15: runsql

    $allaction = $_REQUEST['allaction'];
    if ($allaction == 'delall') {
        $message = runsql('delete from ' . $tbpref . 'tags where (1=1) ' . $wh_query, "Deleted");
        runsql("DELETE " . $tbpref . "wordtags FROM (" . $tbpref . "wordtags LEFT JOIN " . $tbpref . "tags on WtTgID = TgID) WHERE TgID IS NULL", '');
        adjust_autoincr('tags', 'TgID');
    }
} elseif (isset($_REQUEST['del'])) {
    $message = runsql('delete from ' . $tbpref . 'tags where TgID = ' . $_REQUEST['del'], "Deleted");
    runsql("DELETE " . $tbpref . "wordtags FROM (" . $tbpref . "wordtags LEFT JOIN " . $tbpref . "tags on WtTgID = TgID) WHERE TgID IS NULL", '');
    adjust_autoincr('tags', 'TgID');
} elseif (isset($_REQUEST['op'])) {
    // INSERT
    if ($_REQUEST['op'] == 'Save') {
        $message = runsql('insert into ' . $tbpref . 'tags (TgText, TgComment) values(' . convert_string_to_sqlsyntax($_REQUEST["TgText"]) . ', ' . convert_string_to_sqlsyntax_nonull($_REQUEST["TgComment"]) . ')', "Saved", $sqlerrdie = FALSE);
    } elseif ($_REQUEST['op'] == 'Change') {
        $message = runsql('update ' . $tbpref . 'tags set TgText = ' . convert_string_to_sqlsyntax($_REQUEST["TgText"]) . ', TgComment = ' . convert_string_to_sqlsyntax_nonull($_REQUEST["TgComment"]) . ' where TgID = ' . $_REQUEST["TgID"], "Updated", $sqlerrdie = FALSE);
    }
}
// NEW
if (isset($_REQUEST['new'])) {
    ?>

	<h4>New Tag</h4>
	<script type="text/javascript" src="js/unloadformcheck.js" charset="utf-8"></script>	
	<form name="newtag" class="validate" action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">
	<table class="tab3" cellspacing="0" cellpadding="5">
	<tr>
	<td class="td1 right">Tag:</td>
开发者ID:chajadan,项目名称:lwt,代码行数:31,代码来源:edit_tags.php


注:本文中的convert_string_to_sqlsyntax函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。