1

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>
2
Contributors
4
Replies
25
Views
3 Years
Discussion Span
Last Post by lk123456
0

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.

1

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?

1

This worked for me but still needs some tweaking:

('UPDATE products SET description=?, price=? WHERE name=?', [product.description, product.price, product.name]); 
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.