Questions tagged [database-abstraction]

86 questions
342
votes
13 answers

mysqli or PDO - what are the pros and cons?

In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS. I prefer PDO for the…
Polsonby
  • 22,484
  • 19
  • 56
  • 73
25
votes
7 answers

Best PHP DAL (data abstraction layer) so far

What is the best PHP DAL (data abstraction layer) so far developed under any open source project which we could re-use with good faith? I am finding it hard to choose a DAL for my application that sufficiently supports abstraction to most common…
sakhunzai
  • 11,985
  • 19
  • 85
  • 142
14
votes
5 answers

Database abstraction layer design - Using IRepository the right way?

I'm in the process of designing my ASP.NET MVC application and I ran across a couple of interesting thoughts. Many samples I have seen describe and use the Repository pattern (IRepository) so this is the way I did it while I was learning MVC. Now I…
Alastair Pitts
  • 18,689
  • 9
  • 63
  • 95
13
votes
16 answers

What does "data abstraction" exactly mean?

What does data abstraction refer to? Please provide real life examples alongwith.
Naruto
  • 8,950
  • 32
  • 110
  • 191
9
votes
3 answers

Advantages of using Doctrine for PHP?

Just came across the Doctrine Project which has an Object Relational Mapper and a DB Abstraction Layer. What does Doctrine provide that other PHP abstraction layers don't? And what practical use can you put the ORM to, apart from fetching objects…
Robin Rodricks
  • 99,791
  • 133
  • 372
  • 575
7
votes
5 answers

MySQL: Fields length. Does it really matter?

I'm working with some database abstraction layers and most of them are using attributes like "String" which is VARCHAR 250 or INTEGER which has length of 11 digits. But for example I have something that will be less than 250 characters long. Should…
John Gold
  • 247
  • 1
  • 3
  • 6
6
votes
6 answers

Counting the number of results returned by a database query in Codeigniter

I am not having much luck detecting when a database query in Codeigniter returns zero results. I have had a good read of the notes on the PHP count function but am none the wiser! I call the query/view as follows from the controller: $data['result']…
Linker3000
  • 252
  • 1
  • 2
  • 11
6
votes
1 answer

What does Doctrine's Database Abstraction Layer offer over simple PDO?

What do I gain if I use Doctrine's Database Abstraction Layer (DBAL) over simple PDO? Isn't PDO supposed to be an abstraction layer itself? As far as I can tell, the only benefit I gain is the ability to use Oracle's oci8 driver with a PDO-like API.…
cesarv
  • 87
  • 3
6
votes
5 answers

Where do ORMs fall through?

I often hear people bashing ORMs for being inflexible and a "leaky abstraction", but you really don't hear why they're problematic. When used properly, what exactly are the faults of ORMs? I'm asking this because I'm working on a PHP orm and I'd…
ryeguy
  • 60,742
  • 51
  • 186
  • 256
4
votes
2 answers

Difference between Data Access layer and Database Abstraction Layer and refactoring the Database class

Possible Duplicate: What is the difference between Data Abstraction Layer & Data Acess Layer? I just read up this article on nettuts. I got kinda confused. What's the difference between a Data Access Layer and a Database Abstraction Layer? Also,…
maxxon15
  • 1,379
  • 4
  • 19
  • 34
4
votes
4 answers

Database abstraction class design using PHP PDO

I am in the process of designing a web application (really, it's a hobby, and I'm trying to teach myself design, and what better way is there than doing it :). Anyway, I was thinking about how I would deal with my database. I am comfortable with…
TCCV
  • 2,986
  • 4
  • 23
  • 30
4
votes
1 answer

Prepared Statements in libdbi

I want to use libdbi to make an application database-agnostic. I would like to use prepared statements. How can I use prepared statements with libdbi? All the examples I saw use normal select bla from blub where foo; statements and use escaping…
timos
  • 2,557
  • 15
  • 21
3
votes
5 answers

Why should I abstract my data layer?

OOP principles were difficult for me to grasp because for some reason I could never apply them to web development. As I developed more and more projects I started understanding how some parts of my code could use certain design patterns to make them…
Gazillion
  • 4,722
  • 10
  • 38
  • 59
3
votes
1 answer

Database abstraction/adapters for ruby

What are the database abstractions/adapters you are using in Ruby? I am mainly interested in data oriented features, not in those with object mapping (like active record or data mapper). I am currently using Sequel. Are there any other options? I…
Stiivi
  • 2,087
  • 2
  • 16
  • 25
3
votes
3 answers

Joomla - Where to edit the insert SQL?

I'm learning to create MVC component right now. I studied the code that was created using the component creator. Now I wanna to locate the SQL insert function after the save button is click in the edit form, where does the form send to to call the…
1
2 3 4 5 6