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

  • SEARCH
  • Home
  • 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 38013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:38:28+00:00 2026-05-10T14:38:28+00:00

In a project that I’m about to wrap up, I’ve written and implemented an

  • 0

In a project that I’m about to wrap up, I’ve written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out ‘how on earth?’, relax — I haven’t found a way to make late static binding work — I’m just working around it in the best way that I possibly can.

Anyway, I’m not currently using prepared statements for querying, because I couldn’t come up with a way to pass a variable number of arguments to the bind_params() or bind_result() methods.

Why do I need to support a variable number of arguments, you ask? Because the superclass of my models (think of my solution as a hacked-up PHP ActiveRecord wannabe) is where the querying is defined, and so the find() method, for example, doesn’t know how many parameters it would need to bind.

Now, I’ve already thought of building an argument list and passing a string to eval(), but I don’t like that solution very much — I’d rather just implement my own security checks and pass on statements.

Does anyone have any suggestions (or success stories) about how to get this done? If you can help me solve this first problem, perhaps we can tackle binding the result set (something I suspect will be more difficult, or at least more resource-intensive if it involves an initial query to determine table structure).

  • 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-10T14:38:29+00:00Added an answer on May 10, 2026 at 2:38 pm

    In PHP you can pass a variable number of arguments to a function or method by using call_user_func_array. An example for a method would be:

    call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params); 

    The function will be called with each member in the array passed as its own argument.

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

Sidebar

Related Questions

We have a project that uses an Interceptor object to tell NHibernate to do
The project that I'm working on at the moment uses an IDisposable object in
The project that I'm currently working on involves translating a website that was written
I have a project that needs to access a DLL with PHP. The server
We have a PHP project that we would like to version control. Right now
For a new project that I'm doing in PHP I've created an SQLMethods class
The project that I am working on (Node.js) implies lots of operations with the
A project that a group of mine is starting is going to be focused
the project that i am involved in has a lot of small modules that
I currently have one project that currently contains multiple packages. These packages make up

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.