Click here to Skip to main content
15,891,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating search in html5 using local db.

Can any buddy help me to figure out this problem.

query = "SELECT * FROM exhibitors where exhibitor ?;";

How can i using the like condition with "?".
I try following way but not working.

C#
function searchData()
{

    var src=document.getElementById('searchId');

query = "SELECT * FROM exhibitors where exhibitor LIKE %?;";

    try {
        localDB.transaction(function(transaction){

            transaction.executeSql(query, [src.value,src.value,src.value,src.value,src.value], function(transaction, results){
             var row = results.rows.item(0);

                updateExhibitorForm(row['id'], row['exhibitor'], row['logo'], row['contactPerson'], row['designation'], row['address'], row['website'], row['phone'],row['email'], row['profile'], row['standNo'], row['fax']);
                queryAndUpdateSearch(src.value);

            }, function(transaction, error){
                updateStatus("Error: " + error.code + "<br>Message: " + error.message);
            });
        });
    }
    catch (e) {
        updateStatus("Error: Unable to select data from the db " + e + ".");
    }

}
Posted

1 solution

Try:
C#
query = "SELECT * FROM exhibitors WHERE exhibitor LIKE '%?'";
You need the single quotes, and the above will match anything ending with a question mark.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900