Sponsored Content
The Lounge What is on Your Mind? Similar Threads: More UNIX and Linux Forum Topics You Might Find Helpful Update Post 303021550 by Neo on Sunday 12th of August 2018 12:43:41 PM
Old 08-12-2018
Similar Threads: More UNIX and Linux Forum Topics You Might Find Helpful Update

Today I change the DB and the PHP code and rebuilt the database for similar threads at the end of each post, increasing from a max of 5 to a max of 10 similar threads per post:

More UNIX and Linux Forum Topics You Might Find Helpful

It was quite easy to do:

1. Increased the max size of the similar field in the thread DB from 55 to a 120 varchar.

2. Changed a fetch_similar_threads($threadtitle, $threadid = 0) DB PHP query from LIMIT 5 to LIMIT 10.

3. Rebuild the entire thread table of all (currently 280K) threads.

Done!
This User Gave Thanks to Neo For This Post:
 

4 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Similar Threads - a new vB3 feature for UNIX.COM

Note the new feature on UNIX.COM, many thread at the bottom of the page have a new feature: Similiar Threads Here is an example on one of Perderabo's posts: https://www.unix.com/showthread.php?t=16337 Kudos to the vB folks for this built-in feature!! Neo (0 Replies)
Discussion started by: Neo
0 Replies

2. What is on Your Mind?

Forum Update New Steps for UNIX.com

Dear Everyone, Thank you for all the great comments, feedback and patience during our recent modernization efforts at unix.com. Now, I need to decide where to go next, as we move into the next phase. Some of the ideas I have are: Make the UserCP experience and all those non-public... (6 Replies)
Discussion started by: Neo
6 Replies

3. What is on Your Mind?

Similar Threads Redesign for UNIX.com

Hello. I have redesigned our "similar threads" for a more "clean style" in both the desktop view and the mobile view for the forum "show thread". The new design is a simple straight-forward use of div elements and all the legacy table elements have been removed. The result is a "clean"... (7 Replies)
Discussion started by: Neo
7 Replies

4. What is on Your Mind?

Similar Threads for Man Pages - In Development

FYI, I have been quietly updating the man page database adding "similar threads" for man pages. STEP 1: Full Text MySQL DB Search Matches The first step, after creating the DB columns, was to process each of the nearly 400K man pages and do a full text mysql search, match and score... (10 Replies)
Discussion started by: Neo
10 Replies
MYSQLI_FIELD_SEEK(3)							 1						      MYSQLI_FIELD_SEEK(3)

mysqli_result::field_seek - Set result pointer to a specified field offset

       Object oriented style

SYNOPSIS
bool mysqli_result::field_seek (int $fieldnr) DESCRIPTION
Procedural style bool mysqli_field_seek (mysqli_result $result, int $fieldnr) Sets the field cursor to the given offset. The next call to mysqli_fetch_field(3) will retrieve the field definition of the column associ- ated with that offset. Note To seek to the beginning of a row, pass an offset value of zero. PARAMETERS
o $ result -Procedural style only: A result set identifier returned by mysqli_query(3), mysqli_store_result(3) or mysqli_use_result(3). o $fieldnr - The field number. This value must be in the range from 0 to number of fields - 1. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Object oriented style <?php $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = $mysqli->query($query)) { /* Get field information for 2nd column */ $result->field_seek(1); $finfo = $result->fetch_field(); printf("Name: %s ", $finfo->name); printf("Table: %s ", $finfo->table); printf("max. Len: %d ", $finfo->max_length); printf("Flags: %d ", $finfo->flags); printf("Type: %d ", $finfo->type); $result->close(); } /* close connection */ $mysqli->close(); ?> Example #2 Procedural style <?php $link = mysqli_connect("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s ", mysqli_connect_error()); exit(); } $query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5"; if ($result = mysqli_query($link, $query)) { /* Get field information for 2nd column */ mysqli_field_seek($result, 1); $finfo = mysqli_fetch_field($result); printf("Name: %s ", $finfo->name); printf("Table: %s ", $finfo->table); printf("max. Len: %d ", $finfo->max_length); printf("Flags: %d ", $finfo->flags); printf("Type: %d ", $finfo->type); mysqli_free_result($result); } /* close connection */ mysqli_close($link); ?> The above examples will output: Name: SurfaceArea Table: Country max. Len: 10 Flags: 32769 Type: 4 SEE ALSO
mysqli_fetch_field(3). PHP Documentation Group MYSQLI_FIELD_SEEK(3)
All times are GMT -4. The time now is 05:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy