Solved

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

Posted on 2016-09-26
7
113 Views
Last Modified: 2016-10-03
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
Comment
Question by:Eduardo Fuerte
7 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41816892
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
 

Author Comment

by:Eduardo Fuerte
ID: 41819635
Hi

I really could not find the meaning of this code.
By the way the app is perfectly running...
0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 250 total points
ID: 41824343
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 29

Accepted Solution

by:
fibo earned 250 total points
ID: 41824522
Looks furiously like the arguments for a "prepared SQL statement" that the php code would pass to a SQL query.
0
 

Author Closing Comment

by:Eduardo Fuerte
ID: 41826827
You are probably right.

Thanks for help!
0
 
LVL 29

Expert Comment

by:fibo
ID: 41826929
B-) Glad we could help!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I am having a  Git   issue 6 43
Error in Angular 2 when showing in grid 4 25
Log in through ID 5 19
BATCH to EXE Converter 2 40
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question