Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 57223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:39:27+00:00 2026-05-10T17:39:27+00:00

In a PHP project I’m working on we need to create some DAL extensions

  • 0

In a PHP project I’m working on we need to create some DAL extensions to support multiple database platforms. The main pitfall we have with this is that different platforms have different syntaxes – notable MySQL and MSSQL are quite different.

What would be the best solution to this?

Here are a couple we’ve discussed:

Class-based SQL building

This would involve creating a class that allows you to build SQL querys bit-by-bit. For example:

$stmt = new SQL_Stmt('mysql'); $stmt->set_type('select'); $stmt->set_columns('*'); $stmt->set_where(array('id' => 4)); $stmt->set_order('id', 'desc'); $stmt->set_limit(0, 30); $stmt->exec(); 

It does involve quite a lot of lines for a single query though.

SQL syntax reformatting

This option is much cleaner – it would read SQL code and reformat it based on the input and output languages. I can see this being a much slower solution as far as parsing goes however.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:39:28+00:00Added an answer on May 10, 2026 at 5:39 pm

    I’d recommend class-based SQL building and recommend Doctrine, Zend_Db or MDB2. And yeah, if it requires more lines to write simple selects but at least you get to rely on a parser and don’t need to re-invent the wheel.

    Using any DBAL is a trade-off in speed, and not just database execution, but the first time you use either of those it will be more painful than when you are really familiar with it. Also, I’m almost a 100% sure that the code generated is not the fastest SQL query but that’s the trade-off I meant earlier.

    In the end it’s up to you, so even though I wouldn’t do it and it sure is not impossible, the question remains if you can actually save time and resources (in the long run) by implementing your own DBAL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Consider these filenames: C:\temp\file.txt - This is a path, an… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer Your probably going to have to do this with the… May 11, 2026 at 11:43 pm
  • Editorial Team
    Editorial Team added an answer Place a 16x16 favicon.ico file in your websites root directory.… May 11, 2026 at 11:43 pm

Related Questions

In a PHP project I'm working on we need to create some DAL extensions
How can I find any unused functions in a PHP project? Are there features
I just inherited a PHP project that generates large PDF files and usually chokes
I am working on a php project that needs to store information about various
I'm working on a PHP CMS like project and I'm trying to find out

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.