This is my first php program!


Advanced Database Techniques



Download 6,9 Mb.
Pdf ko'rish
bet56/69
Sana26.02.2022
Hajmi6,9 Mb.
#471647
1   ...   52   53   54   55   56   57   58   59   ...   69
Bog'liq
PHP

Advanced Database Techniques
|
197
string(4) "1962"
["name"]=>
string(12) "Sean Connery"
}
The
DB_FETCHMODE_OBJECT
mode turns the row into an object, with a property for each
column in the result row:
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
if (DB::isError($row)) {
die($row->getMessage( ));
}
var_dump($row);
object(stdClass)(3) {
["title"]=>
string(5) "Dr No"
["year"]=>
string(4) "1962"
["name"]=>
string(12) "Sean Connery"
}
To access data in the object, use the
$object->property
notation:
echo "{$row->title} was made in {$row->year}";
Dr No was made in 1962
Finishing the result
A query result object typically holds all the rows returned by the query. This may
consume a lot of memory. To return the memory consumed by the result of a query
to the operating system, use the
free( )
method:
$result->free( );
This is not strictly necessary, as
free( )
is automatically called on all queries when
the PHP script ends.
Disconnecting
To force PHP to disconnect from the database, use the
disconnect( )
method on the
database object:
$db->disconnect( );
This is not strictly necessary, however, as all database connections are disconnected
when the PHP script ends.
Advanced Database Techniques
PEAR DB goes beyond the database primitives shown earlier; it provides several
shortcut functions for fetching result rows, as well as a unique row ID system and
separate prepare/execute steps that can improve the performance of repeated queries.
,ch08.16110 Page 197 Wednesday, March 13, 2002 11:44 AM


This is the Title of the Book, eMatter Edition
Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Download 6,9 Mb.

Do'stlaringiz bilan baham:
1   ...   52   53   54   55   56   57   58   59   ...   69




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish