wordpress/wp-content/plugins/sqlite-integration/functions.php
/**
	 * Method to emulate MySQL FIELD() function.
	 *
	 * This function gets the list argument and compares the first item to all the others.
	 * If the same value is found, it returns the position of that value. If not, it
	 * returns 0.
	 *
	 * @param variable number of string, integer or double
	 * @return unsigned integer
	 */
Method to emulate MySQL FIELD() function.
This function gets the list argument and compares the first item to all the others.
If the same value is found, it returns the position of that value. If not, it
returns 0.

@param variable number of string, integer or double
@return unsigned integer
Method to emulate MySQL FIELD () function . This function gets the list argument and compares the first item to all the others . If the same value is found it returns the position of that value . If not it returns 0 . @param variable number of string integer or double @return unsigned integer
public function field() {
		global $wpdb;
		$numArgs = func_num_args();
		if ($numArgs < 2 or is_null(func_get_arg(0))) {
			return 0;
		} else {
			$arg_list = func_get_args();
		}
		$searchString = array_shift($arg_list);
		$str_to_check = substr($searchString, 0, strpos($searchString, '.'));
		$str_to_check = str_replace($wpdb->prefix, '', $str_to_check);
		if ($str_to_check && in_array(trim($str_to_check), $wpdb->tables)) return;
		for ($i = 0; $i < $numArgs-1; $i++) {
			if ($searchString === strtolower($arg_list[$i])) {
				return $i + 1;
			}
		}
		return 0;
	}
public function field ( ) { global $ wpdb ; $ numArgs = func_num_args ( ) ; if ( $ numArgs < 2 or is_null ( func_get_arg ( 0 ) ) ) { return 0 ; } else { $ arg_list = func_get_args ( ) ; } $ searchString = array_shift ( $ arg_list ) ; $ str_to_check = substr ( $ searchString , 0 , strpos ( $ searchString , '.' ) ) ; $ str_to_check = str_replace ( $ wpdb -> prefix , '' , $ str_to_check ) ; if ( $ str_to_check && in_array ( trim ( $ str_to_check ) , $ wpdb -> tables ) ) return ; for ( $ i = 0 ; $ i < $ numArgs - 1 ; $ i ++ ) { if ( $ searchString === strtolower ( $ arg_list [ $ i ] ) ) { return $ i + 1 ; } } return 0 ; }
Method to emulate MySQL FIELD() function.
Method to emulate MySQL FIELD () function .