How to display txt and img from db?

Hi,
I’m working on a school project (it’s about educational toys) and as part of the project I want to build a simple interactive website. As I never used wix in such complex manner, some help and guidance will be required, which I hope to find here in the Community.
The website will have two pages: Home Page and a second page which will have dynamic content (based on a database).

What I did so far:

  • I created a database
  • I populated the database
  • I learned how to add user input fields
  • I learned the basics about datasets and how to connect a button and an input field to my database
  • I was able to link a text field to my database, to display certain information

What I don’t know how to do:
- use the User Input Field as “search field”, instead of write into the database
- “convince” the dataset on my Dynamic Page to filter based on my User Input Field
- load an image from the database

What I want to do: *please refer to the attached image for clarification

  • I want the user to type a string in an User Input Field (the string will be a bee species, eg. “Wool Carder Bee”)
  • When Pressing ENTER or the button marked GO! in my diagram, I want to display the data associated in the database with “Wool Carder Bee”

*On the final design, the Input Box will be on a static page (Home), but when submitting, the dynamic page should load. Also, the Dynamic page should have a similar input box, in case the user wants to do another search, without returning to homepage.


Now, I am not asking nor expecting for anyone to “do my homework”, but if I could get some help into making the input field/button/image work together, that would mean a lot. Especially with the Image, I couldn’t load image from the DB.

I hope it makes sense. If not, please ask and I’ll explain.

Thank you.

The Search a Database example should give you a good start. I would suggest opening the example in the editor and playing with it. It does a lot of what you are trying to do, as well as letting you actually do some of your own homework. :smiling_face:

Good luck and have fun with Wix Code.

Thank you! So far it has been very helpful. I made things work so far.
Still not finished, so I might return with questions.

@yisrael-wix
I was able to load custom text and image from the db based on the field input, when the GO! button is pressed, as long as the image and text are on the same page with my buttons and dataset.

I was also able to move the image and text on a DYNAMIC PAGE, where the content was changing based on my input (I had to link them to a dynamicDataset). What I could NOT do, was to redirect the user towards the dynamic page, after the button on Home Page was pressed. (not sure if dynamic page makes sense in my case - i was just exploring)

Would you please be so kind to assist me with the following behavior?
1. On Home Page:

  • user inputs a Bee Name and presses GO! button
  • user gets redirected to a Second Page (let’s call it Bee Page) of the website, where the actual bee image and text are loaded.
  • Home Page has just the role of a Welcoming page and initial search, when the website is accessed

2. On Bee Page:

  • on the Bee Page I will also have an Input Field + Button, just in case the user wants to run a second search.

I am not sure if I should use a dynamic page, or a static page, where I’d just change the image and the text. From what I could observe, the dynamic page DOES NOT EXIST, if directly accessed by the link. I guess it gets generated on request and then displayed.


Question: i f I would like to add a QR code on my toy, would it be possible to directly open a specific bee’s page just by scanning that qr-code? This would replace the manual typing. Of course, I don’t want to complicate things too much, as I said, this is just a side part for a school assignment. So, if it gets to hairy, please ignore this question.

Many thanks!