downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

sqlite_has_prev> <sqlite_field_name
Last updated: Fri, 13 Nov 2009

view this page in

sqlite_has_more

(PHP 5, PECL sqlite >= 1.0.0)

sqlite_has_moreまだレコードがあるかないかを返す

説明

bool sqlite_has_more ( resource $result )

与えられた結果セット中にまだレコードがあるかどうかを見つけます。

パラメータ

result

SQLite 結果リソース

返り値

result ハンドルにまだレコードがある場合 TRUE を返します。そうでない場合 FALSE を返します。

参考

  • sqlite_num_rows() - 結果セットのレコード数を返す
  • sqlite_changes() - 直近のSQLステートメントにより変更されたレコード数を返す



add a note add a note User Contributed Notes
sqlite_has_more
dcchut at gmail dot com
02-Feb-2009 12:39
dragosmocrii at gmail dot com:

It is slightly more efficient to use the COUNT function. (And when I say slightly I mean whisker small slightly.)

<?php
// $db is a SQLite database connection

if (sqlite_single_query($db, 'SELECT COUNT(*) FROM records WHERE amount_owing > 500')) {
   
// There are records where the amount owing exceeds $500, do some action.
} else {
   
// No money for you!
}

?>
dragosmocrii at gmail dot com
06-Apr-2008 06:08
I use this function to check if an element exists in the database.

<?php
$cat
=$_REQUEST['cat'];
$db=sqlite_open('./sqlite_database.db',0666,$err) or die();
$query='select * from catsub where cat=\''.$cat.'\'';
$result=sqlite_has_more(sqlite_query($db,$query));
if(
$result===true ) echo 'Exists'; else echo 'Doesnt Exist';
sqlite_close($db);
?>

sqlite_has_prev> <sqlite_field_name
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites