Solved

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

Posted on 2016-09-26
7
91 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 82

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Read about why website design really matters in today's demanding market.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to dynamically set the form action using jQuery.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now