hyde Posted August 14, 2007 Share Posted August 14, 2007 Hi, I'd be very thankful if anyone could help me with this. I have one table with a description field and other info, and I also have another table with a list of names and picture url:s. When I display the text description on my site I'd like to know if there are a match with a name from the 'names' table in the text. Example: Table1 ------ description="this is a sample text that includes the name Bill Gates" Table2 ------ name="Bill Gates" picture="billgates.jpg" In this example there is a match as Bill Gates is found in the text. Then I'd like to display the image of Bill Gates. Please let me know if you can help me with this as I'm totally lost. Quote Link to comment https://forums.phpfreaks.com/topic/64896-how-can-i-find-a-name-from-one-table-in-a-text-from-another-table/ Share on other sites More sharing options...
lemmin Posted August 14, 2007 Share Posted August 14, 2007 "WHERE name LIKE '%Bill Gates%'" That should find the substring in the field. Of course you can switch "Bill Gates" with a variable, but leave the percent symbols. Quote Link to comment https://forums.phpfreaks.com/topic/64896-how-can-i-find-a-name-from-one-table-in-a-text-from-another-table/#findComment-323772 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.