Jump to content

danjacko

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

danjacko's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Guys, I'm developing a script for a friend and have run into a problem. I'm trying to make a system whereby the user enters ingredients (like keywords or tags) and the system will output recipes based on the input. In the database I was planning to make it look something like: ID (Primary) | Recipe | Ingredients 1 cake flour, sugar and when the user enters ingredients such as flour, the script will return will cake. Using VARCHAR wouldn't work because querying SELECT Recipe FROM $table WHERE Ingredients = flour wouldn't return any results because there is no row where Ingredients are equal to just flour. and what about if the user inputted 'sugar, flour' the database wouldn't recognize them because 'sugar, flour' != 'flour, sugar'. So any easy way of doing this would be if the data were arrays of data in one field. One thing I was thinking was to have about 20 columns and each ingredient in a separate column then for a php script to scan down every column until it finds a matching ingredient. Then it would log that ingredient and if all the ingredients are matched it returns a positive match on a recipe. However this idea is really long winded and would take hours to code. It would also be quite hard for a user to interact with it so does anyone have any better ideas? Many Thanks
  2. Thanks you so much! Worked perfectly. For anyone who reads this topic again there is a ] missing and the code i now use is
  3. I have tried But this failed as it wont allow me to redefine the function when i tried a different link. Then I tried. Yet this didn't work because it only included the last link and when i tried to click another link it wouldn't change from the last one
  4. What i'm trying to do is have 20 HTML (href) links and a PHP include under the links. What I want is when a link is clicked the PHP include changes to a different file. Im sorry if its not very clear but i'm pretty new to PHP so don't know if its possible... Please can someone help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.