![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | ||
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,126
|
![]() I have a table of recipes, all have unique id's.
What I'd like to be able to do is to add an article to a separate table, then, below that article on the .php page, display a listing of recipes from the first table that contain a specific keyword, such as 'bacon' to go with the article about bacon. Is it possible to run an SQL querie in the .php code to display the article AND, have another array below that that displays say, 5 records from the recipe table. I have a single article.php file that pulls based on the ID in the table containing articles, but not what the article is based on so article.php?id=1 for example, pulls up the bacon article. How do I make it so that I can also pull up JUST 5 recipes that also contain 'bacon' in their ingredients list? What is that called? Pulling from 2 different tables based on a specific keyword? If I need to I can add a category to both tables if that makes it any easier overall to achieve what I need? This is what I have currently for the article.php page: Quote:
Quote:
I was thinking I could use an include but that does not seem to be possible (?) ![]() Any pointers as to what I should be looking into (if even possible) would be appreciated ![]() |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Apr 2019
Posts: 657
|
Try looking up JOIN and/or UNION.
__________________
__________________ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,126
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |