Jump to content

amazon style searching

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
happy

happy

    Newbie

  • Members
  • PipPip
  • 25 posts
Hello people, im new to this forum, but hopefuly after i become stronger in programming i will be a long standing member. Let me tell you what I have so far and then explain what im trying to do in PHP.

I have an sql database with three tables containing details of local bands.
table 1 = artists with these columns
artistid(pk) int
artist_name text
genre text

table 2 = albums
ablumid(pk) int
artistid int
album_name text
year int

table 3 = tracks
tackid(pk) int
albumid int
artistid int
track_name text
video_stream boolean
video_download boolean

Now i want to create a php interface which has a text box a drop down box and a search button. in the drop down box contains asrtists, albums, tracks, and genre.

in the text box the user types the appropriate text on what the are searching for., selects an area in the dropdown box then the appropriresults are returned. then it would say is that band has tracks with videos available.

I have no idea where to start with this. any clues or help, suggestions would be greatly appreciated.

thanks in advance

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You can use the database to search with a LIKE query.

SELECT * FROM tracks WHERE track_name LIKE %{$phpVariableHere}


#3
happy

happy

    Newbie

  • Members
  • PipPip
  • 25 posts
Thanks for that. IM connecting to my databse with this method

$conn = pg_connect("host=host_address user=****** password=******** dbname=344740"); 


and i dont know how to create a textbox in php with text that is assigned a variable name once the search button is hit.