Jump to content

Valace

New Members
  • Posts

    1
  • Joined

  • Last visited

Valace's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to code a search feature for a client on a website that was built years ago, so the way it was coded is a little outdated, but still works just fine. Basically I'm trying to get the search results to paginate. I tried with multiple queries but I couldn't get them to paginate properly, so I figured I'd try searching all necessary tables with a single query, which is returning the error "MySQL client ran out of memory". I'm not using any joins, which may be the issue. I've tried looking up how to incorporate joins, but the articles that I've read seem to be geared toward looking for matching data between tables, whereas I'm trying to search all tables for keywords submitted by the user's search. Can someone tell me if I'm using this correctly? And maybe give me some advice? $sql = "SELECT subsections.id, subsections.name, subsections.description, products.id, products.code, products.name, products.description, pages.id, pages.title, pages.content, blog_entries.id, blog_entries.name, blog_entries.content FROM subsections, products, pages, blog_entries WHERE subsections.name LIKE '%".mysql_real_escape_string($keywords)."%' OR subsections.description LIKE '%".mysql_real_escape_string($keywords)."%' OR products.code LIKE '%".mysql_real_escape_string($keywords)."%' OR products.name LIKE '%".mysql_real_escape_string($keywords)."%' OR products.description LIKE '%".mysql_real_escape_string($keywords)."%' OR pages.title LIKE '%".mysql_real_escape_string($keywords)."%' OR pages.content LIKE '%".mysql_real_escape_string($keywords)."%' OR blog_entries.name LIKE '%".mysql_real_escape_string($keywords)."%' OR blog_entries.content LIKE '%".mysql_real_escape_string($keywords)."%'"; Any help would be greatly appreciated.
×
×
  • 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.