[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Could you point how to deal with this kind of PHP notation?

Hi Experts

Could you point how to deal with this kind of PHP notation?

f.e.
%company_id$d

$query = static::procedure_query('call', 'get_dashboard_current',
            '%company_id$d, %date_begin$s, %date_end$s, %month$d, %group_id$s', $params);

Open in new window


The legacy code I'm maintaing is FuelPHP, I don't know if it's a particular feature of FuelPHP or of in general PHP.

Thanks in advance
0
Eduardo Fuerte
Asked:
Eduardo Fuerte
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
I suspect that usage is peculiar to your code or FuelPHP.  The standard usage for '%' is as a modulus operator in arithmetic.  http://php.net/manual/en/language.operators.arithmetic.php
0
 
Eduardo FuerteAuthor Commented:
Hi

I really could not find the meaning of this code.
By the way the app is perfectly running...
0
 
Steve BinkCommented:
Judging on my light research, I'm guessing this was a wrapper around a method used to call parameterized procedures through the FuelPHP DAL.  It does not appear to be any standard syntax from Fuel.  The syntax of the parameters looks like a custom format: '%', <name of parameter>, '$', <type of data>.  For example, the first would be a decimal/integer parameter named company_id.  I would also guess that $params is an array in which the keys match those parameter names.

This is all guesswork, though.  You'll need to find the definition of procedure_query() to know for sure.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
fiboCommented:
Looks furiously like the arguments for a "prepared SQL statement" that the php code would pass to a SQL query.
0
 
Eduardo FuerteAuthor Commented:
You are probably right.

Thanks for help!
0
 
fiboCommented:
B-) Glad we could help!
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now