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

search for in the

sqlite_close> <sqlite_busy_timeout
Last updated: Fri, 19 Mar 2010

view this page in

sqlite_changes

SQLiteDatabase->changes

(PHP 5, PECL sqlite >= 1.0.0)

sqlite_changes -- SQLiteDatabase->changesEn son SQL deyiminin değiştirdiği satır sayısını döndürür

Açıklama

int sqlite_changes ( resource $db )

Nesne yönelimli kullanım

SQLiteDatabase
int changes ( void )

En son SQL deyiminin db veritabanında değiştirdiği satır sayısını döndürür.

Değiştirgeler

db

SQLite Veritabanı özkaynağı. Yordamsal kullanımda sqlite_open() işlevi tarafından döndürülür. Nesne yönelimli kullanımda bu değiştirgeye gerek yoktur.

Dönen Değerler

Değişen satır sayısı.

Örnekler

Örnek 1 - Yordamsal kullanım örneği

<?php
$dbhandle 
sqlite_open('mysqlitedb');
$query sqlite_query($dbhandle,
        
"UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!
$query) {
    exit(
'Sorguda hata.');
} else {
    echo 
'Değişen satır sayısı: 'sqlite_changes($dbhandle);
}
?>

Örnek 2 - Nesne yönelimli kullanım örneği

<?php
$dbhandle 
= new SQLiteDatabase('mysqlitedb');
$query $dbhandle->query(
        
"UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!
$query) {
    exit(
'Sorguda hata.');
} else {
    echo 
'Değişen satır sayısı: '$dbhandle->changes();
}
?>

Ayrıca Bakınız

  • sqlite_open() - Bir SQLite veritabanı için bir tanıtıcı açar, veritabanı mevcut değilse oluşturur



add a note add a note User Contributed Notes
sqlite_changes
bermi ferrer:at-akelos dotCom
28-Sep-2005 01:02
When counting deleted records from the database, I realized that sqlite_changes() will return 0 if you are deleting all the records without including a WHERE clause.

So after "DELETE FROM users" sqlite_open() will print 0 even if rows where deleted, but if you use "DELETE FROM users WHERE 1" you will get the right result.

I had this problem on versions 5.0.4 and 4.4.0 under Windows servers.

sqlite_close> <sqlite_busy_timeout
Last updated: Fri, 19 Mar 2010
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites