Nauka programowania php
Prosty kurs dla amatorów
XXIII. DB++ Functions
| Ostrzeżenie |
Ten moduł jest w stadium EKSPERYMENTALNYM. Oznacza to, że zachowanie tych funkcji, ich nazwy, w zasadzie wszystko udokumentowane tutaj może zostać zmienione w przyszłych wersjach PHP bez wcześniejszego uprzedzenia. Używaj tego modułu na własne ryzyko. |
Wstęp
db++, made by the German company Concept asa, is a relational database system with high performance and low memory and disk usage in mind. While providing SQL as an additional language interface, it is not really a SQL database in the first place but provides its own AQL query language which is much more influenced by the relational algebra than SQL is.
Concept asa always had an interest in supporting open source languages, db++ has had Perl and Tcl call interfaces for years now and uses Tcl as its internal stored procedure language.
Wymagania
This extension relies on external client libraries so you have to have a db++ client installed on the system you want to use this extension on.
Concept asa provides db++ Demo versions and documentation for Linux, some other Unix versions. There is also a Windows version of db++, but this extension doesn't support it (yet).
Instalacja
In order to build this extension yourself you need the db++ client libraries
and header files to be installed on your system (these are included in the
db++ installation archives by default). You have to run
configure with option --with-dbplus to
build this extension.
configure looks for the client libraries and header files
under the default paths /usr/dbplus,
/usr/local/dbplus and /opt/dblus.
If you have installed db++ in a different place you have add the installation
path to the configure option like this:
--with-dbplus=/your/installation/path.
Konfiguracja uruchomieniowa
To rozszerzenie nie definiuje posiada żadnych dyrektyw konfiguracyjnych w pliku php.ini.
Typy zasobów
dbplus_relation
Most db++ functions operate on or return
dbplus_relation resources. A
dbplus_relation is a handle to a stored
relation or a relation generated as the result of a query.
Stałe predefiniowane
Poniższe stałe są zdefiniowane w tym rozszerzeniu i stają się dostępne, gdy rozszerzenie jest dokompilowane do PHP, lub załadowane dynamicznie przy starcie.
db++ error codes
Tabela 1. DB++ Error Codes
| PHP Constant | db++ constant | meaning |
|---|---|---|
| DBPLUS_ERR_NOERR (integer) | ERR_NOERR | Null error condition |
| DBPLUS_ERR_DUPLICATE (integer) | ERR_DUPLICATE | Tried to insert a duplicate tuple |
| DBPLUS_ERR_EOSCAN (integer) | ERR_EOSCAN | End of scan from rget() |
| DBPLUS_ERR_EMPTY (integer) | ERR_EMPTY | Relation is empty (server) |
| DBPLUS_ERR_CLOSE (integer) | ERR_CLOSE | The server can't close |
| DBPLUS_ERR_WLOCKED (integer) | ERR_WLOCKED | The record is write locked |
| DBPLUS_ERR_LOCKED (integer) | ERR_LOCKED | Relation was already locked |
| DBPLUS_ERR_NOLOCK (integer) | ERR_NOLOCK | Relation cannot be locked |
| DBPLUS_ERR_READ (integer) | ERR_READ | Read error on relation |
| DBPLUS_ERR_WRITE (integer) | ERR_WRITE | Write error on relation |
| DBPLUS_ERR_CREATE (integer) | ERR_CREATE | Create() system call failed |
| DBPLUS_ERR_LSEEK (integer) | ERR_LSEEK | Lseek() system call failed |
| DBPLUS_ERR_LENGTH (integer) | ERR_LENGTH | Tuple exceeds maximum length |
| DBPLUS_ERR_OPEN (integer) | ERR_OPEN | Open() system call failed |
| DBPLUS_ERR_WOPEN (integer) | ERR_WOPEN | Relation already opened for writing |
| DBPLUS_ERR_MAGIC (integer) | ERR_MAGIC | File is not a relation |
| DBPLUS_ERR_VERSION (integer) | ERR_VERSION | File is a very old relation |
| DBPLUS_ERR_PGSIZE (integer) | ERR_PGSIZE | Relation uses a different page size |
| DBPLUS_ERR_CRC (integer) | ERR_CRC | Invalid crc in the superpage |
| DBPLUS_ERR_PIPE (integer) | ERR_PIPE | Piped relation requires lseek() |
| DBPLUS_ERR_NIDX (integer) | ERR_NIDX | Too many secondary indices |
| DBPLUS_ERR_MALLOC (integer) | ERR_MALLOC | Malloc() call failed |
| DBPLUS_ERR_NUSERS (integer) | ERR_NUSERS | Error use of max users |
| DBPLUS_ERR_PREEXIT (integer) | ERR_PREEXIT | Caused by invalid usage |
| DBPLUS_ERR_ONTRAP (integer) | ERR_ONTRAP | Caused by a signal |
| DBPLUS_ERR_PREPROC (integer) | ERR_PREPROC | Error in the preprocessor |
| DBPLUS_ERR_DBPARSE (integer) | ERR_DBPARSE | Error in the parser |
| DBPLUS_ERR_DBRUNERR (integer) | ERR_DBRUNERR | Run error in db |
| DBPLUS_ERR_DBPREEXIT (integer) | ERR_DBPREEXIT | Exit condition caused by prexit() * procedure |
| DBPLUS_ERR_WAIT (integer) | ERR_WAIT | Wait a little (Simple only) |
| DBPLUS_ERR_CORRUPT_TUPLE (integer) | ERR_CORRUPT_TUPLE | A client sent a corrupt tuple |
| DBPLUS_ERR_WARNING0 (integer) | ERR_WARNING0 | The Simple routines encountered a non fatal error which was corrected |
| DBPLUS_ERR_PANIC (integer) | ERR_PANIC | The server should not really die but after a disaster send ERR_PANIC to all its clients |
| DBPLUS_ERR_FIFO (integer) | ERR_FIFO | Can't create a fifo |
| DBPLUS_ERR_PERM (integer) | ERR_PERM | Permission denied |
| DBPLUS_ERR_TCL (integer) | ERR_TCL | TCL_error |
| DBPLUS_ERR_RESTRICTED (integer) | ERR_RESTRICTED | Only two users |
| DBPLUS_ERR_USER (integer) | ERR_USER | An error in the use of the library by an application programmer |
| DBPLUS_ERR_UNKNOWN (integer) | ERR_UNKNOWN |
- Spis treści
- dbplus_add -- Add a tuple to a relation
- dbplus_aql -- Perform AQL query
- dbplus_chdir -- Get/Set database virtual current directory
- dbplus_close -- Close a relation
- dbplus_curr -- Get current tuple from relation
- dbplus_errcode -- Get error string for given errorcode or last error
- dbplus_errno -- Get error code for last operation
- dbplus_find -- Set a constraint on a relation
- dbplus_first -- Get first tuple from relation
- dbplus_flush -- Flush all changes made on a relation
- dbplus_freealllocks -- Free all locks held by this client
- dbplus_freelock -- Release write lock on tuple
- dbplus_freerlocks -- Free all tuple locks on given relation
- dbplus_getlock -- Get a write lock on a tuple
- dbplus_getunique -- Get an id number unique to a relation
- dbplus_info -- Get information about a relation
- dbplus_last -- Get last tuple from relation
- dbplus_lockrel -- Request write lock on relation
- dbplus_next -- Get next tuple from relation
- dbplus_open -- Open relation file
- dbplus_prev -- Get previous tuple from relation
- dbplus_rchperm -- Change relation permissions
- dbplus_rcreate -- Creates a new DB++ relation
- dbplus_rcrtexact -- Creates an exact but empty copy of a relation including indices
- dbplus_rcrtlike -- Creates an empty copy of a relation with default indices
- dbplus_resolve -- Resolve host information for relation
- dbplus_restorepos -- Restore position
- dbplus_rkeys -- Specify new primary key for a relation
- dbplus_ropen -- Open relation file local
- dbplus_rquery -- Perform local (raw) AQL query
- dbplus_rrename -- Rename a relation
- dbplus_rsecindex -- Create a new secondary index for a relation
- dbplus_runlink -- Remove relation from filesystem
- dbplus_rzap -- Remove all tuples from relation
- dbplus_savepos -- Save position
- dbplus_setindex -- Set index
- dbplus_setindexbynumber -- Set index by number
- dbplus_sql -- Perform SQL query
- dbplus_tcl -- Execute TCL code on server side
- dbplus_tremove -- Remove tuple and return new current tuple
- dbplus_undo -- Undo
- dbplus_undoprepare -- Prepare undo
- dbplus_unlockrel -- Give up write lock on relation
- dbplus_unselect -- Remove a constraint from relation
- dbplus_update -- Update specified tuple in relation
- dbplus_xlockrel -- Request exclusive lock on relation
- dbplus_xunlockrel -- Free exclusive lock on relation
| Poprzedni | Spis treści | Następny |
| timezone_transitions_get | Początek rozdziału | dbplus_add |
Newsy:
Nowości z listy dyskusyjnej
Witam,
Nie potrafiê programowaæ w ¿adnym jêzyku a jest mi potrzebny taki ma³y programik, oto opis:
Wyglada³by mniej wiêcej tak:

I chodzi o to zeby w miejsce A wpisac jak±¶ dowoln± liczbe,
W miejscu B powinna siê od razu pojawiæ liczba [A+(A*0,1)]*1,22 zaokr±glone do czê¶ci setnych,
W miejscu C powinna siê od razu pojawiæ liczba [A+(A*0,2)]*1,22 zaokr±glone do czê¶ci setnych,
W miejscu D powinna siê od razu pojawiæ liczba [A+(A*0,3)]*1,22 zaokr±glone do czê¶ci setnych,
I dzia³a³by w systemie windows.
Mam taki test i co prawa ju¿ go pisa³em ale nie wiem jakie s± dobre odpowiedzi moze kto¶ mi pomo¿e??
http://www.kolejland.rail.pl/iz/Forum%20-%...wania/jipp2.jpg
Moje odpowiedzi to:
1. a
2. abc
3. bc
4. d
5. ad
Plisss bardzo potrzebny nam jest taki program!!!
Witam,
Jak w temacie zlecê napisanie od nowa lub zmodyfikowanie istniej±cej ju¿ wersji programu do obliczania sum md5. Zainteresowanych proszê o kontakt.
Autor strony Polishwords rozwa¿a przej¶cie na model Open Source. Aby u³atwiæ sobie decyzjê umie¶ci³ ankietê, w której mo¿na zag³osowaæ za albo przeciwko przej¶ciu na Open Source. Pomó¿my autorowi!
Strona Polishwords jest przeznaczona dla programistów i ogó³ informatyków. Zawiera filmy instrukta¿owe z programowania i zarz±dzania baz± danych. Autor rozwa¿a obecnie przej¶cie na model Open Source i opublikowanie kodu strony. Chcia³by przez to osi±gn±æ szybszy rozwój strony i zaanga¿owanie wiêkszej liczby programistów PHP.
W umieszczonej ankiecie mo¿na zag³osowaæ czy autor powinien przej¶æ na model Open Source. Pomó¿ podj±æ dobr± decyzjê autorowi.
Wiêcej na: http://polishwords.com.pl/blog/2008/polishwords-open-source/
Jak nie znasz jezyka C++ i wskaznikow i programowania obiektowego
Kurs
Kurs powstał w celu nauki podstawowych zagadnień z dziedziny php.
Losowe tagi:
oopcookies
filter
ircg
pcre