With the help of sqlite_fetch_single, you can quickly and easily calculate the number of elements in the table
<?php
$db = new SQLiteDatabase('database.db', 0666);
$db->queryExec("
CREATE TABLE inbox (
inbox_id INTEGER NOT NULL PRIMARY KEY,
inbox_send varchar(20) NOT NULL,
inbox_text TEXT NOT NULL,
inbox_time INTEGER UNSIGNED NOT NULL,
inbox_user varchar(20) NOT NULL
);");
$ins_query = "
INSERT INTO inbox (inbox_send, inbox_text, inbox_time, inbox_user) VALUES ('Ilia1', 'Message1', '".time()."', 'my_name');
INSERT INTO inbox (inbox_send, inbox_text, inbox_time, inbox_user) VALUES ('Ilia2', 'Message2', '".time()."', 'user');
INSERT INTO inbox (inbox_send, inbox_text, inbox_time, inbox_user) VALUES ('Ilia2', 'Message3', '".time()."', 'my_name');
";
$db->queryExec($ins_query);
$total = $db->singleQuery("SELECT count(*) FROM inbox WHERE inbox_user='my_name';");
echo $total;
?>