Error SQL

Hi @Teodor ,

I have an error during an update, and I don't know what it means, thank you

<div class="form-group">
                                                <label for="inp_typeProjets" class="">Type projets</label>
                                                <div class="form-check form-switch">
                                                    <input class="form-check-input" type="checkbox" id="inp_typeProjetssp" name="typeProjetssp" dmx-bind:value="inp_typeProjetssp.checked ? 1 : 0" dmx-bind:checked="scSelection.data.query.typeProjets==1">
                                                    <label class="form-check-label" for="inp_typeProjetssp" dmx-show="inp_typeProjetssp.value==1">Privé</label><label class="form-check-label" for="inp_typeProjetssp" dmx-show="inp_typeProjetssp.value==0">Public</label>
                                                </div>

                                            </div>

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE (idProjets = ?)' at line 1

How is the update condition set up? Please show a screenshot.

Also in this code:

<input class="form-check-input" type="checkbox" id="inp_typeProjetssp" name="typeProjetssp" dmx-bind:value="inp_typeProjetssp.checked ? 1 : 0" dmx-bind:checked="scSelection.data.query.typeProjets==1">

this part is wrong:

dmx-bind:value="inp_typeProjetssp.checked ? 1 : 0"

you should not set a value like this, you should set this to a static value:

value="1"

When a checkbox is not checked it won't set any value.

So your whole code need to become:

    <div class="form-group">
        <label for="inp_typeProjets" class="">Type projets</label>
        <div class="form-check form-switch">
            <input class="form-check-input" type="checkbox" id="inp_typeProjetssp" name="typeProjetssp" value="1" dmx-bind:checked="scSelection.data.query.typeProjets==1">
            <label class="form-check-label" for="inp_typeProjetssp" dmx-show="inp_typeProjetssp.checked">Privé</label><label class="form-check-label" for="inp_typeProjetssp" dmx-show="!inp_typeProjetssp.checked">Public</label>
        </div>
    </div>

I found it thanks, a missing field in a query, thanks