23 Jun 2010

YES.

23 Jun 2010 08:59 pm
kaigou: life would be easier if I had the source code. (3 source code)
$result = mysql_query("SELECT `termid` FROM connected_texts");
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
    $orig_term_tax_id = $row['termid'];
    $result2 = mysql_query("SELECT * FROM term_relationships WHERE `term_taxonomy_id` = '$orig_term_tax_id'");
    while ($row2 = mysql_fetch_array($result2, MYSQL_BOTH)) {
        $objectid_textid = $row2[0];
        if (!$bookpart) {
            $result3= mysql_query("SELECT `bookpart` FROM `texts` WHERE `textid`='$objectid_textid'");
            while ($row3 = mysql_fetch_array($result3, MYSQL_BOTH)) {
                $bookpart = $row3['bookpart'];
                if ($bookpart == '1') {
                $bookno = $objectid_textid;
                $result4= mysql_query("UPDATE connected_texts SET `textid` = '$bookno' WHERE `termid` = '$orig_term_tax_id'");
                }
            }
        }
        $result3= mysql_query("SELECT `bookpart` FROM `texts` WHERE `textid`='$objectid_textid'");
        while ($row3 = mysql_fetch_array($result3, MYSQL_BOTH)) {
            $result4= mysql_query("UPDATE texts SET `book` = '$bookno' WHERE `textid` = '$objectid_textid'");
        }
    }
    $bookpart = '';
}


It's amazing what your brain can do when it's not got two tons of unhappy perched on top.

whois

kaigou: this is what I do, darling (Default)
锴 angry fishtrap 狗

to remember

"When you make the finding yourself— even if you're the last person on Earth to see the light— you'll never forget it." —Carl Sagan

October 2016

S M T W T F S
      1
2345678
91011 12131415
16171819202122
23242526272829
3031     

summary

expand

No cut tags