Jump to content

Recommended Posts

For the first time i will be trying to add any databases to my site( well the website is first in php as well taking help from this forum itself), which database would be good for me( a begineer). Procedural, object orients or PDO ( im not sure all webhost offers this or not ). 

 

What is the basic difference between object oriented and procedural databases?

Link to comment
https://forums.phpfreaks.com/topic/297810-which-databases-to-use/
Share on other sites

You mean procedural and object-oriented code for interacting with databases? Because databases themselves are... neither. Question doesn't make sense.

 

Procedural tends to mean a lot of copy and paste, with all the bad things that can mean. Object-oriented makes nicer code.

Because whenever you want to run a query, you'll find yourself going to some other place in code where you do a query, copying the code there to connect to the database (because you don't remember the server or username or password), and pasting it in the new code. And if anything there changes, like if you moved to a new host, then you'd have to go through the code you have, change the information, then copy and paste the changed code to everywhere else you need.

 

With OOP you put most of that code into a class. There's still some code that you write/copy elsewhere, but there's less of it and it's much less likely to change in the future.

Edited by requinix

The bigger question these days is:

 

-Relational data store (mysql,postgresql,oracle,sqlserver) or non-relational/nosql/document oriented (mongodb, cassandra, couchbase)

 

-if relational, straight API vs db class?

 

-if db class, create your own vs use existing

 

- if db class, use ORM (doctrine2, propel, laravel eloquent)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.