Skip to content

Instantly share code, notes, and snippets.

View gpickin's full-sized avatar

Gavin Pickin gpickin

View GitHub Profile
<cfsetting requesttimeout="600">
<cfparam name="thelogname" default="clean_maillogH.log">
<cfinclude template="stopwatch.cfm">
<cfset ds = "dev_bktools">
<cfset stopwatch = makeStopwatch()>
<cfoutput>
<cfset stopwatch.start("Begin timing")>
if ( len(arguments.email) lte 5) {
// email too short
return 0;
}
else if ( len(arguments.password) eq 0 ) {
// empty password
return 0;
}
else {
var userDAO = uDAO;
if ( len(arguments.email) gt 5) {
if ( len(arguments.password) eq 0 ) {
var userDAO = uDAO;
var user = userDAO.getUserByLogin( arguments.email, arguments.password );
if ( user.recordcount gt 0)
if ( user.deletedat gt "") {
//login successful
return user.id;
}
else {
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 7
Created January 22, 2015 16:47
Getting Started with WebSQL in your Mobile App - Code 7
db.readTransaction(function (tx) {
tx.executeSql('SELECT * FROM doctors', [], function( tx, res ){ console.log(res.rows.item(0).doctorName); } );
});
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 6
Last active August 29, 2015 14:13
Getting Started with WebSQL in your Mobile App - Code 6
db.transaction(function (tx) {
tx.executeSql(’SELECT * FROM doctors’,
[],
function( tx, result ){
var len = results.rows.length, i;
for (i = 0; i < len; i++) {
console.log(results.rows.item(i).doctorName);
}
},
function( tx, error ){}
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 5
Created January 22, 2015 16:43
Getting Started with WebSQL in your Mobile App - Code 5
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS doctors (id unique, doctorName)’);
tx.executeSql(‘INSERT INTO doctors (id, doctorName) values(?,?)’, [1,”9th Doctor”]);
});
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 4
Created January 22, 2015 16:41
Getting Started with WebSQL in your Mobile App - Code 4
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS doctors (id unique, doctorName)’);
tx.executeSql(‘INSERT INTO doctors (id, doctorName) values(1,”9th Doctor”)');
});
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 1
Created January 22, 2015 16:33
Getting Started with WebSQL in your Mobile App - Code 1
var dbSize = 5 * 1024 * 1024; // 5mb initial database
var db = openDatabase(“GavinsDB", "", “Gavins DB", dbSize,
function() {
console.log('db successfully opened or created');
},
function() {
console.log('db error');
}
);
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 2
Created January 22, 2015 16:38
Getting Started with WebSQL in your Mobile App - Code 2
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE doctors (id unique, doctorName)');
});
@gpickin
gpickin / Getting Started with WebSQL in your Mobile App - Code 3
Created January 22, 2015 16:40
Getting Started with WebSQL in your Mobile App - Code 3
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS doctors (id unique, doctorName)');
});