Hi,

WebSQL has been deprecated but it is still useful for some applications at this time.

How would I update a row of data saved into WebSQL, when using a foreach KnockoutJS binding?

 <table class='producttable'>
2.            <tr>
3.                <th>Name</th>
4.                <th>Description</th>
5.                <th>Price</th>
6.            </tr>
7.            <tbody data-bind="foreach: products">
8.                <tr>
9.                    <td>
10.                        <input data-bind='value: name' />
11.                    </td>
12.                    <td><input data-bind='value: description' /></td>
13.                    <td><input data-bind='value: price' /> </td>
14.                                </tr>
15.                            </tbody>
16.  </table>

Hi,

I have resolved the previous issue but was unsure if I could continue to use that thread or needed to create a new thread.

I have tried:

function updateproduct(product) {
    db.transaction(function (tx) {
        tx.executeSql('UPDATE products SET name=? WHERE id=?', [product.name]);
        });
        }

However, this does not work, am I on the right lines and need to make a few tweaks?

This worked for me but still needs some tweaking:

('UPDATE products SET description=?, price=? WHERE name=?', [product.description, product.price, product.name]); 
Be a part of the DaniWeb community

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