By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,303 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,303 IT Pros & Developers. It's quick & easy.

[PHP 4.4.6] BerkeleyDB or equivalent?

P: n/a
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:

---------------
Configure Command ./configure --with-mysql=/usr/local/mysql
--with-config-file-path=/opt3/local/apache/conf --with-gd
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-jpeg-dir=/usr/local --with-ttf=/usr
--with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
--with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
--with-imap-ssl=/usr/local/ssl --without-kerberos
--with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
--with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
--with-curl=/usr/local/ --with-mcrypt=/usr/local
--with-ming=/usr/local --with-gettext=/usr/local
--with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
--with-regex=system --with-pear --enable-ftp --enable-bcmath
--enable-mbstring --enable-exif --enable-calendar
--enable-memory-limit --enable-trans-sid --enable-libgcc
--enable-inline-optimization --disable-debug

Apache
Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
---------------

If not, is there some PHP source file that I can include in my script?

Thank you.
May 8 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Gilles Ganault wrote:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:

---------------
Configure Command ./configure --with-mysql=/usr/local/mysql
--with-config-file-path=/opt3/local/apache/conf --with-gd
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-jpeg-dir=/usr/local --with-ttf=/usr
--with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
--with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
--with-imap-ssl=/usr/local/ssl --without-kerberos
--with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
--with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
--with-curl=/usr/local/ --with-mcrypt=/usr/local
--with-ming=/usr/local --with-gettext=/usr/local
--with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
--with-regex=system --with-pear --enable-ftp --enable-bcmath
--enable-mbstring --enable-exif --enable-calendar
--enable-memory-limit --enable-trans-sid --enable-libgcc
--enable-inline-optimization --disable-debug

Apache
Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
---------------

If not, is there some PHP source file that I can include in my script?

Thank you.
How big is your DB? If it is small enough to fit into memory, you can
simply store it in a php file:

file db.php

<? $DB=array('Bob'=>'bobs phone','Tom'=>'toms phone' etc);

file main.php:
include 'db.php';

// manipulate $DB array
.....

// save
file_put_contents('db.php', '<?$DB=' . var_export($DB,1));
--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 8 '07 #2

P: n/a
At Tue, 08 May 2007 07:38:58 +0200, Gilles Ganault let his monkeys type:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:
Thank you.
Use phpinfo() to see what's supported by your host.
I wonder what makes you want to go BerkelyDB instead of MySQL though.

Sh.
May 8 '07 #3

P: n/a
Try sqlite. You'll need to reconfigure PHP with the extention, but I
think it's what you're looking for.
http://www.sqlite.org/

May 8 '07 #4

P: n/a
On Tue, 08 May 2007 09:13:51 +0200, gosha bine <st********@gmail.com>
wrote:
>How big is your DB? If it is small enough to fit into memory, you can
simply store it in a php file:
Thanks. I'll give it a shot.
May 9 '07 #5

P: n/a
On May 8, 1:38 am, Gilles Ganault <nos...@nospam.comwrote:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing
MySQL does have a BerkelyDB interface, but I'm not sure if this is
relevant in your case

http://dev.mysql.com/doc/refman/5.0/...ge-engine.html

-Mike PII

May 9 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.