Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

function return boolean

$
0
0

i wish that a function can return an boolean. But i get only " { } ". This function is in a file in the forlder "lib". Thanks :) code:

function searchDb(titleSearch){
    var result =  false;
    var db = Ti.Database.open('db_application');
    var requeteRS = db.execute('SELECT id, title FROM news WHERE title ="'+titleSearch+'"');
    while (requeteRS.isValidRow()) {
        result = true;
        requeteRS.next();
    }
    requeteRS.close();
    db.close();
    return result;
};
exports.searchDb = searchDb;

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>