2
sqlite: regular functions
7
if (!extension_loaded("sqlite")) print "skip"; ?>
10
include "blankdb.inc";
15
array("three", "tres"),
18
sqlite_query("CREATE TABLE strings(a,b)", $db);
20
function implode_args()
22
$args = func_get_args();
23
$sep = array_shift($args);
24
return implode($sep, $args);
27
foreach ($data as $row) {
28
sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($row[0]) . "','" . sqlite_escape_string($row[1]) . "')", $db);
31
sqlite_create_function($db, "implode", "implode_args");
33
$r = sqlite_query("SELECT implode('-', a, b) from strings", $db);
34
while ($row = sqlite_fetch_array($r, SQLITE_NUM)) {
53
string(10) "three-tres"