simple php/mysql ad system
I am trying to make a simple advertising system using php/mysql. Say I have 2 tables: one for keywords of the pages ads can appear on, and one for all of the possible ads. Something like this:

Page keywords table (2 columns, unlimited rows - called "keywords"):                      
Page:------------------------Keywords:                                 

page1.php-------------------cat, goat                                    
page1.php-------------------dog                                 
page1.php-------------------cow, donkey                                 
page2.php-------------------cheeseburger                                 


and the second table (called "ads")                             
Ad_id:-----------------------Keywords:       
                          
1----------------------------animals, cats, dogs, cow, cows, sheep                                 
2----------------------------cats                                 
3----------------------------stapler                                 

Say the user is currently on page1.php (I know the first table is a bit of a weird setup, but yes, the keywords for the same page may be on multiple lines). I need a php/sql script to evaluate which ad to show. It would also have to recognize "like" matches (dog=dogs, etc). I think sql has a built in function?

Could anyone help me out?

Thanks a lot!

simple php/mysql ad system
===

I am trying to make a simple advertising system using php/mysql. Say I have 2 tables: one for keywords of the pages ads can appear on, and one for all of the possible ads. Something like this:

Page keywords table (2 columns, unlimited rows - called "keywords"):                      
Page:------------------------Keywords:                                 

page1.php-------------------cat, goat                                    
page1.php-------------------dog                                 
page1.php-------------------cow, donkey                                 
page2.php-------------------cheeseburger                                 


and the second table (called "ads")                             
Ad_id:-----------------------Keywords:       
                          
1----------------------------animals, cats, dogs, cow, cows, sheep                                 
2----------------------------cats                                 
3----------------------------stapler                                 

Say the user is currently on page1.php (I know the first table is a bit of a weird setup, but yes, the keywords for the same page may be on multiple lines). I need a php/sql script to evaluate which ad to show. It would also have to recognize "like" matches (dog=dogs, etc). I think sql has a built in function?

Could anyone help me out?

Thanks a lot!
