Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/19/2024 in all areas

  1. You need to join the two tables on the link_id so you match the terms to their parent link Do you have a specific reason for using a fulltext search? Would a simpler "LIKE" suffice. For example SELECT l.id as linkID , l.url , t.term FROM links l JOIN terms t ON l.id = t.link_id WHERE t.term LIKE '%ine%' OR l.url LIKE '%ine%'; linkID | url | term ----------+----------------+----------------- 2 | page2.php | zine 2 | page2.php | magazine 2 | page2.php | online
    1 point
  2. Hey Andou, Thanks for that link. I read it and someone was having the same problem as me. When the guy said he changed the encoding type, I instantly knew what was wrong with it. In movie_desc attribute I had a word in single quotes : ‘Nicky’ - When I was reading the print_r from the array is was rendering that word with question marks on either side. I didn't think much of it - until I read that thread!
    1 point
  3. PS I am in complete agreement with @kicken - you need to restructure your tables +---------------+ | link | +---------------+ | id (PK) |-----+ | url | | +---------------+ +---------------+ | | term | | +---------------+ | | id (PK) | +-----<| link_id (FK) | | term | +---------------+ So that your data looks like this... TABLE: link TABLE: term +-----+-------------------+ +-----+---------+---------------------+ | id | url | | id | link_id | term | +-----+-------------------+ +-----+---------+---------------------+ | 1 | page1.php | | 1 | 1 | Zeitgeist | | 2 | page2.php | | 2 | 1 | conspiracy theories | +-----+-------------------+ | 3 | 1 | 9/11 | | 4 | 1 | 9 11 | | 5 | 2 | zine | | 6 | 2 | magazine | | 7 | 2 | online | | 8 | 2 | newspaper | | 9 | 2 | press | | 10 | 2 | alternative | | 11 | 2 | coldtype | | 12 | 2 | world news | +-----+---------+---------------------+ Then all you need is a couple of simple queries. (My reply to your previous topic assumed were using a correctly normalized design as above)
    1 point
  4. Here's my solution using your (terrible) data structure... giving If you want those beginning with 'z', then giving
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.