My web hosting plan does not include a database. Is there a way i can get around this? Like upload a .sql file or ms access db into my server and connect to it using php?

Hi,

starting from PHP 5.3, SQLite3 is enabled by default, this would allow you to create an sqlite file and connect to it:

In both cases it requires that on compilation the hosting didn't disabled the support. Looking at phpinfo() you should be able to find if is supported or not.

Before implementing SQLite read these pages carefully:

Otherwise, if allowed, use an external database service.

Thanks for Cereal, it works.

Thanks a lot. it worked like magic. its good cos I don't have to pay extra money for a database

Ok, now don't forget to apply an .htaccess rule to avoid remote downloads of the sqlite file:

<FilesMatch ".+\.(db|sqlite)$">
Order Deny, Allow
Deny from all
</FilesMatch>

This will match any file with extension .db or .sqlite and deny remote access.

Docs:

Then, if we are finished, please mark the thread as solved. Bye! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.