Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004

    Searching through several mysql tables with php...

    Does that work? if so how?

    This is what im doing currently...
    Im building a search engine kinda like google for PC game cheats.
    Not just pc games i will crawl playstation cheats aswell.
    Anyways i want my tables like this

    cheatcc = the cheat website name im crawling same with 123cheats.




    Now if someone clicks to search through PC cheats i want it to search through the two tables cheatcc_pc_cheats and 123cheats_pc_cheats and print results of course.
    I have never tryed coding a search engine before so im pretty new at this part.
    I would be happy if someone could post some inputs.

    Best Regards

  2. #2
    Join Date
    Sep 2004
    Ive built the search engine but i just dont know how to make it search through several mysql tables.

    $query = "select * from cheatcc_com_pc where title like \"%$trimmed%\"
    order by title";

  3. #3
    Join Date
    Apr 2005
    Canada... EH?!?
    You could just do a join... i dont know if your database supports it... and it might cripple your system if you have millions of rows.... so what i would say is create an array with all the table names and create a virtual id so for example

    cheatcc_pc_cheats - 1
    cheatcc_ps2_cheats - 2

    123cheats_pc_cheats - 3
    123cheats_ps2_cheats - 4

    and then just make a loop that will query the table depending on the number eg

    "SELECT bla FROM " . $array(3) . "WHERE this=this ORDER BY id; ---- would be from 123cheats_pc_cheats

    and do that for the tables and dump the results on a webpage or another array.

    I dont know how functional that would be.... I am a mostly .NET programmer -- just learning php good luck

  4. #4
    Join Date
    Jan 2003
    You should have origin site as a table column, rather than making separate tables for each one (which will scale very badly). In fact, you may want to dissect the database system in something like phpbb, which deals with many of the same scaling issues you will encounter.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts