//if(!isset($_REQUEST["oldroot"])) die("'oldroot' is not set.");
//if(!isset($_REQUEST["newroot"])) die("'newroot' is not set.");
$oldroot = $_REQUEST["oldroot"];
$newroot = $_REQUEST["newroot"];
print "oldroot=" . MysqlHieroglyphics::htm_img($oldroot) . ",newroot=" . MysqlHieroglyphics::htm_img($newroot) . ", confirm=" . $_REQUEST["confirm"] . "<br><br>";
//$oldroot = "A53";
//$newroot = "---";
if (strlen($oldroot) == 0) {
    die(" oldroot is empty.");
}
if (strlen($newroot) == 0) {
    die(" newroot is empty.");
}
$harr = new MysqlHieroglyphics();
$sql = "SELECT hid, hink FROM Hieroglyphics WHERE hink LIKE '%{$oldroot},%'";
$myarr = $harr->query($sql);
foreach ($myarr as $row) {
    $hid = $row['hid'];
    print MysqlHieroglyphics::htm_img($hid);
    print "<a>==</a>";
    $orglnk = $row['hink'];
    print MysqlHieroglyphics::htm_img($orglnk);
    print "<br>";
    $newlnk = MysqlHieroglyphics::replace_root_of_links($oldroot, $newroot, $orglnk);
    //preg_replace("/$oldroot/i", $newroot, $orglnk);
    print $newlnk . "<br>";
    print MysqlHieroglyphics::htm_img($hid);
    print "<a>==</a>";
    print MysqlHieroglyphics::htm_img($newlnk);
    print "<br>";
    if (isset($_REQUEST["confirm"]) && $_REQUEST["confirm"] == "on") {
        foreach ($ret as $indx => $row) {
            $jidstr .= $row[0] . ",";
        }
        //print_r($ret);
        //echo $jidarr;
        //syslog(0, "jidstr=".  $jidstr);
        //echo $jidstr;
        return $jidstr;
    }
}
$h2j = new Hid2jinks();
//echo $jc->get_jinks($hid);
$sql = "SELECT hid FROM Hieroglyphics";
//
$hiero = new MysqlHieroglyphics();
$ret = $hiero->query($sql);
foreach ($ret as $indx => $row) {
    $hid = $row[0];
    $htoj = $h2j->get_jinks($hid);
    if ("" == $htoj) {
        continue;
    }
    //echo $htoj ;
    //echo "<br>";
    $sql = "UPDATE Hieroglyphics SET htoj='{$htoj}' WHERE hid='{$hid}'";
    $sql = "UPDATE Hieroglyphics SET htoj='{$htoj}' WHERE hid='{$hid}'";
    $ret = $hiero->execute($sql);
    echo $sql . "<br>";
}
die;
//'58740,61788,58733,58723,61786,58721,58724,58725,58741,58742,63044,58754,63379,61539,61772,61789,58722,63296,'
Exemplo n.º 3
0
        die("err mixed type for update");
    }
    syslog(0, "to run sql:" . $sql);
    $ret = $odb->execute($sql);
    if (0 == $ret) {
        die("err " . $sql);
    }
    print $sql;
    die("");
} else {
    if ("Hieroglyphics" == $db) {
        $sql = "SELECT * FROM Hieroglyphics WHERE hid='{$keyId}'";
        syslog(0, "sql=" . $sql);
        //die("err test");
        $odb = new MysqlHieroglyphics();
        $ret = $odb->query($sql);
        if (count($ret) != 1) {
            die("err query:" . $sql);
        }
        $row = $ret[0];
        $dbstr = "row | ";
        foreach ($row as $key => $val) {
            syslog(0, "Hieroglyphics prepare for undo:" . $key . "=" . $val);
            if (is_numeric($key)) {
                continue;
            }
            $dbstr .= $key . "=" . $val . " | ";
        }
        syslog(0, $dbstr);
        if (!isset($row[$sc])) {
            $row[$sc] = "";
Exemplo n.º 4
0
<?php

require_once "../MysqlHieroglyphics.php";
//mysql_query("UPDATE Persons SET Age = '36'
//WHERE FirstName = 'Peter' AND LastName = 'Griffin'");
//"UPDATE animals SET animal_name='bruce' WHERE animal_name='troy'"
//print_r($_REQUEST);
if (!isset($_REQUEST["jid"])) {
    die("err= no hid");
}
$hid = $_REQUEST["jid"];
$jgw = new MysqlHieroglyphics();
$sql = "SELECT hink FROM Hieroglyphics WHERE hid='{$hid}'";
//0:idx,1:jid,2:zid,3:freq
$ret = $jgw->query($sql);
//print_r($ret);
if (isset($ret[0])) {
    print $ret[0]["hink"];
} else {
    print "err: no ret";
}
//print_r( $result );
//printf("update ret=%d : %s-->%s",$ret, $jid, $linkjidcodes);
//print_r($_REQUEST);
Exemplo n.º 5
0
">
<select id="sql" name="sql">
<option></option>
<option>SELECT * FROM Hieroglyphics</option>
<option>SELECT * FROM Hieroglyphics LIMIT 0,10</option>
<option>SELECT * FROM Hieroglyphics WHERE hink LIKE '%,%'</option>
<option>SELECT * FROM Hieroglyphics WHERE hink LIKE '%,%'</option>
</select>
<button type="submit">OK</button>
</form>

<?php 
require_once "../uti/Ureaddir.php";
require_once "../uti/MysqlHieroglyphics.php";
$againstDir = "../uti/jgw/mer/compound/p/";
$againstDir = "../../odb/tbi/img/jgif/";
$jia = new MysqlHieroglyphics();
$sql = "SELECT * FROM Jiaguwen ORDER BY jid";
$sql = "SELECT * FROM Hieroglyphics";
if (isset($_REQUEST["sql"]) && strlen($_REQUEST["sql"]) > 0) {
    $sql = $_REQUEST["sql"];
}
echo $sql . "<br>\n";
$ret = $jia->query($sql);
echo "count=" . count($ret) . "<br>";
$jia->show_table($ret);
?>


</body>
</html>