MyBB Community Forums

Full Version: Query/Search google or amazon based on field value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok here is the setup. I have a page that displays all the games currently listed for the Nintendo Wii.

What I want to do is to enhance this database by allowing for two things to happen, one of which I believe is possible. The other of which I highly doubt.

The first one, which seems to be more possible than not, is to concatenate the value of a field in my table mybb_wiigames with a search string provided by google or amazon. So if google's standard search string is this:

http://www.google.com/search?q=Search+String

and the value in my database is:

Wii Sports

then it would return:
http://www.google.com/search?q=Wii+Sports

This would of course be an <a href> for the words "More Info" as already displayed on my page.
-----------------------------------------------------------------------

I think I can do this in SQL, maybe....but it would be tough and I am looking for advice.

The second thing would be to query some type of image database and do the same thing for "Game Cover" column where I display a true photo of the game. Now if possible, I would just upload this image into my database but I am not sure how that would be possibly through mysql without getting the image link and pasting it in for all 170 games...UGH!

If any of this is possible or if I am just crazy - let me know.
I think I answered my own question.

Through a series of 3 sql statements and 3 columns, I was able to achieve my desired results.

While you only needed 2 columns to do this, I wanted to set it up so that all default values were retrievable from the database.

My results are here: http://freemywii.com/forums/wiigames.php

As you can see, clicking the GAME SEARCH! yields a search result from Google.com for that specific game title. While it's not an exact science and some results are hit or miss, it succeeds in its purpose to be a quick reference for users as needed - all from the comfort of FreeMyWii.com!

Thanks guys. Let me know if you have any input on question #2 in regards to the pictures. I have seen this done with dvd aficianado .com where it pulls back the dvd case artwork based of an imdb or amazon search string.

Peace!
Mike