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 6334023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:34:45+00:00 2026-05-24T18:34:45+00:00

I get a don’t get any errors or warning. My table is called products

  • 0

I get a don’t get any errors or warning. My table is called products and the field is called name. I want to find the revelance between first and second column.

Why am I missing here?

<?php

mysql_connect("localhost"," "," ");
mysql_select_db(" ");
mysql_query('set names utf8');

$query = mysql_query("SELECT t1.name AS first FROM products t1");
$row = mysql_fetch_assoc($query);
if (!$query) {
    die('Invalid query: ' . mysql_error());
}

do {
    $first = $row['first'];
    $query2 = mysql_query("SELECT t1.name AS first,
                                 t2.name AS second,
                                 (MATCH (t2.name) AGAINST ('$first')) AS relevance
FROM products t1, products t2
                          WHERE t1.name = '$first'
                          ORDER BY relevance DESC");
if (!$query2) {
    die('Invalid query: ' . mysql_error());
}
    $most_similar = mysql_fetch_assoc($query2);
} while ($row = mysql_fetch_assoc($query));
?>
  • 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-24T18:34:47+00:00Added an answer on May 24, 2026 at 6:34 pm

    There is no t2 in your query, but in your select you have t2.name as second.

    Actually, you don’t have a FROM clause at all…

    Edit:

    This is a random guess at what you’re trying to achieve…I don’t really know, but you should be able to edit the query as needed.

    $query2 = mysql_query("SELECT '$first' AS first,
                                 t.name AS second,
                                 (MATCH (t.name) AGAINST ('$first')) AS relevance
                          FROM products t
                          ORDER BY relevance DESC");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't get any errors with my code, but after I hit the spam
I don't get it. I want to check if the time out of the
I don't get it... I want to enable findbugs report in a Maven 3
I don't get the actual (semantic) difference between the two expressions. It is said
I don't get why SQL does not like my query: @unreadmessages = Message.find(:all, :conditions
I don't get the exact method to do this. I want a method not
I don't get any error, but its not showing anything in the simulator. I
I don't get the difference between git rebase origin and git rebase origin/master .
I don't get it why is it that the relationship in my table is
I don't get it, What I want to do is not when its loading

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.