Multiple functions?

I am showing an cd-collection with php and js. It’s working fine.
But what if I want to show a second cd-collection?
I have tryed to copy the first function and gave it another name, but it wont work.
Does anyone know how??

Just to clarify.
I want to show both collections at the same time on different places on the page.

Code should be general-purpose and reusable. You would store the information about the cd collection(s) in a database. If you want to display n sections of content on one page, you would just query to get the amount of data you want and loop over it to produce the output. If you want to support showing an unlimited number of collections, your code would query to get the title(s) and produce navigation link(s), with an id value in the link. When a link is clicked, your code would use the id value to query for the matching content and display it.

This would then ‘automatically’ adapt to however many pieces of information is stored in the database. All you need to do is add, edit, or delete the stored data. There’s no need to touch the code.

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service