Sponsored Content
The Lounge What is on Your Mind? Temporarily Disabled MySQL Update for Man Pages Post 303040464 by Neo on Wednesday 30th of October 2019 12:46:30 AM
Old 10-30-2019
If anyone (Akshay when back from vacation?) can improve this, please suggest something:

Code:
<?php

function updateDB($os, $section, $query, $text, $raw = '')
{
    global $vbulletin;
    $dateline = time();
    $string = substr($text, 0, 20);
    $snippet = trim(preg_replace('/\s+/', ' ', $string));
    $token = $os . '_' . $section . '_' . $query;
    if (strlen($token) >= 1) {
        $sql = 'INSERT INTO neo_man_page_entry
        (os, section, query, text, formatted,  token, strlen, dateline )
    VALUES
        ("' .
        htmlentities($os, ENT_QUOTES) . '","' .
        htmlentities($section, ENT_QUOTES) . '","' .
        htmlentities($query, ENT_QUOTES) . '","' .
        htmlentities($text, ENT_QUOTES) . '","' .
        htmlentities($raw, ENT_QUOTES) . '","' .
        htmlentities($token, ENT_QUOTES) . '",' .
        strlen($raw) . ',' .
            $dateline . ')
    ON DUPLICATE KEY UPDATE
        dateline = ' . $dateline . ',hits = hits +1';
        $status = $vbulletin->db->query_write($sql);
        return $status;

    } else {
        $file = '/var/log/apache2/debug/neo_update_mandb_entry_error.log';
        $uid = $vbulletin->userinfo['userid'];
        $text = $raw = "unknown";
        error_log(date(DATE_RFC822) . " UID " . $uid . ' token ' . $token . ' len ' . strlen($text) . ' snip ' . $snippet . "\n", 3, $file);
        return -1;
    }

}


and:


Code:
mysql> describe neo_man_page_entry;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| manid     | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| token     | varchar(120)     | NO   | UNI | NULL    |                |
| dateline  | int(11) unsigned | NO   |     | NULL    |                |
| os        | varchar(16)      | NO   | MUL | NULL    |                |
| section   | varchar(8)       | NO   |     | NULL    |                |
| query     | varchar(64)      | NO   | MUL | NULL    |                |
| text      | mediumtext       | NO   | MUL | NULL    |                |
| formatted | mediumtext       | NO   |     | NULL    |                |
| strlen    | int(10) unsigned | NO   |     | 0       |                |
| hits      | int(10) unsigned | NO   |     | 1       |                |
+-----------+------------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Man pages

Hello , I just installed openssh in my system . I actually tried to man sshd but it says no entry , though there is a man directory in the installation which have the man pages for sshd . Can anyone tell me how should i install these man pages . DP (2 Replies)
Discussion started by: DPAI
2 Replies

2. UNIX for Dummies Questions & Answers

man pages

Hi, I've written now a man pages, but I don't knwo how to get 'man' to view them. Where have I to put this files, which directories are allowed?? THX Bensky (3 Replies)
Discussion started by: bensky
3 Replies

3. Programming

Man pages for C API for MySql

Hi, I am on Ubuntu 9.04 tweaking some programs demanding MySql queries. I got the program working by installing following package: sudo apt-get install libmysqlclient-dev and using proper include and library folder However I was unable to access any man pages for these C api's (Strangely... (1 Reply)
Discussion started by: dheerajsuthar
1 Replies

4. HP-UX

Looking for some man pages.

Can anyone supply me with the man pages for: omnidatalist omnibarlist omnisap.exe I prefer the source man pages in nroff format. A clue about the software bundles which supply these man pages is fine as well. OS: HP-UX TIA (11 Replies)
Discussion started by: sb008
11 Replies
MYSQL_FIND_ROWS 					       MySQL Database System						   MYSQL_FIND_ROWS

NAME
mysql_find_rows - extract SQL statements from files SYNOPSIS
mysql_find_rows [options] [file_name ...] DESCRIPTION
mysql_find_rows reads files containing SQL statements and extracts statements that match a given regular expression or that contain USE db_name or SET statements. The utility was written for use with update log files (as used prior to MySQL 5.0) and as such expects statements to be terminated with semicolon (;) characters. It may be useful with other files that contain SQL statements as long as statements are terminated with semicolons. Invoke mysql_find_rows like this: shell> mysql_find_rows [options] [file_name ...] Each file_name argument should be the name of file containing SQL statements. If no file names are given, mysql_find_rows reads the standard input. Examples: mysql_find_rows --regexp=problem_table --rows=20 < update.log mysql_find_rows --regexp=problem_table update-log.1 update-log.2 mysql_find_rows supports the following options: o --help, --Information Display a help message and exit. o --regexp=pattern Display queries that match the pattern. o --rows=N Quit after displaying N queries. o --skip-use-db Do not include USE db_name statements in the output. o --start_row=N Start output from this row. COPYRIGHT
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Sun Microsystems, Inc. (http://www.mysql.com/). MySQL 5.1 04/06/2010 MYSQL_FIND_ROWS
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy