pastebin v0.1.7
web
Feb 21 2012 10:59 AM
hits: 11
#Boycopt
Feb 21 2012 7:37 AM
hits: 13
#Boycopt
Feb 21 2012 7:33 AM
hits: 8
#Boycopt
Feb 21 2012 7:26 AM
hits: 11
#Boycopt
Feb 21 2012 7:24 AM
hits: 9
Anonymous Argentina
Feb 17 2012 11:00 AM
hits: 27
aa with doubles, rea
Feb 15 2012 1:54 PM
hits: 12
aa with doubles.
Feb 15 2012 1:53 PM
hits: 6
aa
Feb 15 2012 1:35 PM
hits: 10
error
Feb 4 2012 5:34 PM
hits: 28
Anonymous
Jan 31 2012 4:15 AM
hits: 53
Anonymous
Jan 30 2012 1:29 PM
hits: 39

Valid HTML 4.01 Strict

Valid CSS!


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
+ (int)intFromDatabase:(FMDatabase *)db query:(NSString *)queryString
{
	int retVal = 0;
	FMResultSet *rs = [db executeQuery:queryString, nil];
	if ([rs next])
	{
		retVal = [rs intForColumnIndex:0];
	}
 
	[rs close];
	return retVal;	
}
 
+ (int)recordCountFromDatabase:(FMDatabase *)db fieldName:(NSString *)inFieldName
					 tableName:(NSString *)inTableName whereClause:(NSString *)inWhereClause
{
	return [Utils intFromDatabase:db 
                            query:[NSString stringWithFormat:@"select count(%@) as ctr from %@ where %@",
                                            inFieldName, inTableName, inWhereClause]];	
}
 
+ (int)maxValueFromDatabase:(FMDatabase *)db fieldName:(NSString *)inFieldName
				  tableName:(NSString *)inTableName whereClause:(NSString *)inWhereClause
{
	int retVal = 0;
	NSString *sql = [NSString stringWithFormat:@"select max(%@) as maxval from %@ where %@",
					 inFieldName, inTableName, inWhereClause];
	FMResultSet *rs = [db executeQuery:sql, nil];
	if ([rs next])
	{
		retVal = [rs intForColumn:@"maxval"];
	}
 
	[rs close];
	return retVal;
}
 

paste below
title
language
description/question
action