How to set the correct stored value in a select menu?

Im creating an Update Job page, so currently im pulling in the jobid from the url.

My Update page has a form with a few input fields and a select menu.

The input fields are being populated correctly by the stored values for the record, from the Jobs db table.

I then have a separate Database Query pulling in the Client Names into this Select menu of my form from a separate db table.

My question is…
How do i make this Select menu highlite the correct Client Name instead of defaulting to the first Customer Name?

Just bind the value from your details data source to the “selected value” field of the select menu.

That doesnt seem to be working.

I can show the correct client name and id in the page (code below), but its not highlighting in the select menu even though i have set it as the ‘selected value’… see screenshots below.

<h1>Update Job Number: {{[0].jobid}}</h1>
        Client: {{[0].cname}} <br>
        Client ID: {{[0].clientid}}

What exactly is the value in the selected value field?

Looks fine, can you provide a link to your page where i can check this, please?

its on my macbook. i can upload it somewhere, do u need ftp or just look at the source in a browser?

I need an access to some server where this site runs, so i can inspect it in my browser.
Please upload it to some test location, which i can access.

ive just uploaded the site, but which file would i find the connection settings in, as they need changing.

Well … setup a new target for this project, add your new ftp details, then change to this target and edit your connection details in the database connection step.

Where is the database connection step?

I added dev01 as a new Target, then set the Target to this, and then clicked Upload at top right in Local Files panel.

All files have been uploaded, but no option to set connection to mysql?

The database connection step is located in your server action, where you define your database connection :slight_smile:

the problem i have now is that my cpanel will not allow remote connections to mysql. So when i put in the connection details… Wappler won’t allow me to save the connection, as it tries to test it first, which then errors.

with Wordpress (for example) i can simply find the connection settings in the php, then manaully edit them. Job done. Can i not do the same?

You do not need to connect remotely.

  1. Setup a target which points to your server (ftp)
  2. Switch to this target and edit the connection

When you are connected to your target, you do not connect remotely as the files are being puished there directly - so not remote connection is required.

ive done steps 1 and 2, but as mentioned, if i put in different connection details, it always tried to test them, i cannot just save them.

If you are connected to your server, selecting your target, then there won’t be issues. It will test, and the results will be fine. Please double check your connection settings and your ftp details. Also check the selected target.

ftp works fine with the selected target.
Normally i would leave the mysql server address as Localhost… but when i add the correct db, user and pass i get the error saying it will not connect, then it will not save the connection details.

Yes, as you are connecting from the server the address will probably be localhost (whatever our hosting provider sent you). But then there is some error when connecting to this database. Please double check all the details again - username, password, database name.

thats my point, i beleive the host firewall blocks external connections.
Ideally i just want to save the connection details, without test them…