You will need to supply more information so that we can help you. What have you done so far? What is working and what isn’t working? Show us a sample of the code you are using and what sort of database.
Meanwhile, these working examples should be able to help you: