Sample Code Help

Good Day!

I want to retrieve a data from my Database “dbase1” from a column name “num” and
if the num is equal to “0” a
url from “dbase1” column “url1” will be use for button on my page
else if num is greater than 0
url from “dbase1” column “url2” will be use for button on my page

End
How should i put this in Page Code

Thanks for Help

Thank you for your comment …but i’m having a a hard time to implement this code…

Jonats,

you should use the following syntax - let myElement = $w(“#myElement”);
there are lots of examples and articles at Wix Editor Elements ($w) - Velo API Reference - Wix.com, please have a look.

Shlomi

I can’t make it work… no background in java here…or other webprogramming

In the example above: $w(“#myElement”); the term myElement is the id of your component, invyour case i think it is demo, you can define your components ids in their settings and then reference then in your code

Good luck,
Shlomi