Hi,

How would I save the data inputted into a list into WebSQL, when using a foreach knockoutjs binding?

 <table class='producttable'>
            <tr>
                <th>Name</th>
                <th>Description</th>
                <th>Price</th>
            </tr>
            <tbody data-bind="foreach: products">
                <tr>
                    <td>
                        <input data-bind='value: name' />
                    </td>
                    <td><input data-bind='value: description' /></td>
                    <td><input data-bind='value: price' /> </td>
                                </tr>
                            </tbody>
  </table>
Member Avatar

Hmm, hasn't webSQL been deprecated?

I have resolved this issue:

function saveproduct(product) {
    db.transaction(function (tx) {
        tx.executeSql('INSERT INTO products (name, description, price) VALUES (?, ?, ?)', [product.name, product.description, product.price]);
    });
}

I am now unsure of how to update a row of data that has been saved into WebSQL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.