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 for diafol

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.