Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6068769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:45:01+00:00 2026-05-23T09:45:01+00:00

I have two tables. One stores video information, the other stores the tags associated

  • 0

I have two tables. One stores video information, the other stores the tags associated with that video. They share the common field vid_id. I am trying to fulltext search both tables for matches. The goal is that if there is a match in either table, then all fields with that vid_id be gathered from video.

The problem is my query just crashes with Call to undefined method PDOConnectionFactory::errorInfo(). It should return one row since there is one entry in tags where name field = test. Anyone have any ideas? I have been struggling with this for a while.

CREATE TABLE IF NOT EXISTS `tags` (
  `id` varchar(35) NOT NULL,
  `vid_id` varchar(35) NOT NULL,
  `name` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  UNIQUE KEY `vid_id` (`vid_id`,`name`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `video` (
  `timestamp` int(11) NOT NULL,
  `vid_id` varchar(32) NOT NULL,
  `file_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `uploader` varchar(55) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `title` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `subject_id` int(1) NOT NULL,
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

$sql = "SELECT video.*
  MATCH(video.title) AGAINST('?') as cscore, 
  MATCH(tags.name) AGAINST('?') as htscore
FROM video
LEFT JOIN tags ON video.vid_id=tags.vid_id
WHERE
  MATCH(video.title) AGAINST('?') OR
  MATCH(tags.name) AGAINST('?')
ORDER BY cscore DESC;";
$stmt4 = $conn->prepare($sql);
$result=$stmt4->execute(array('test','test','test','test')) or die(print_r($db->errorInfo(), true));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:45:02+00:00Added an answer on May 23, 2026 at 9:45 am

    The problem is that you’re missing a comma (,) after SELECT video.* in your SQL query.

    Working example:

    SELECT video.*,
      MATCH(video.title) AGAINST('?') as cscore, 
      MATCH(tags.name) AGAINST('?') as htscore
    FROM video
    LEFT JOIN tags ON video.vid_id=tags.vid_id
    WHERE
      MATCH(video.title) AGAINST('?') OR
      MATCH(tags.name) AGAINST('?')
    ORDER BY cscore DESC;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables. One with information about properties. The other stores 3 images
I have two tables: one that stores blogs and the other that stores images
I have two tables, one is 'tags' that stores tid (auto increment) and name
I have two tables, one that has 450 rows, the other is a Sort
I have two tables, one that stores serial number uut_build , and another for
I have two tables, one that stores user earnings and another that stores the
I have two tables, one that stores incoming messages and one that stores outgoing
I have two database tables. One table stores data for a commitment that a
I have the following two tables, one stores order information, one stores key|value information.
I have two tables one is table Profile and other is table Profile_location (stores

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.