Web site builder - 550 CHAPTER 22 SQLITE Note The NULL
550 CHAPTER 22 SQLITE Note The NULL character typically signals the end of a binary string, while 0×01 is the escape character used within binary data. Therefore, to ensure that the escape character was properly interpreted by the binary data parser, it would need to be decoded. When you re using user-defined functions, a topic discussed in the next section, you should never use this function. Instead, use the sqlite_udf_encode_binary() and sqlite_udf_decode_binary() functions. Both are introduced in the next section. Creating and Overriding SQLite Functions An intelligent programmer will take every opportunity to reuse code. Because many databasedriven applications often require the use of a core task set, there are ample opportunities to reuse code. Such tasks often seek to manipulate database data, producing some sort of outcome based on the retrieved data. As a result, it would be quite convenient if the task results could be directly returned via the SQL query, like so: sqlite>SELECT convert_salary_to_gold(salary) …> FROM employee WHERE empID=1″; PHP s SQLite library offers a means for registering and maintaining customized functions such as this. This section shows you how it s accomplished. sqlite_create_function() boolean sqlite_create_function (resource dbh, string func, mixed callback [, int num_args]) The sqlite_create_function() function enables you to register custom PHP functions as SQLite user-defined functions (UDFs). For example, this function would be used to register the convert_salary_to_gold() function discussed in the opening paragraphs of this section, like so: From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.