Solved

What do the parameters in the PDO function debugDumpParams mean?

Posted on 2017-02-23
1
34 Views
Last Modified: 2017-02-24
When I run that functionality, I get this:

function name:reggie_id

SQL: [194] Select registrationeventid from tblregistrationeventtoscreening where screeningperiodid in (select screeningperiodid from tblscreeningsubperiod where screeningsubperiodid =:screeningsubperiodid)
Params:  1
Key: Name: [21] :screeningsubperiodid
paramno=0
name=[21] ":screeningsubperiodid"
is_param=1
param_type=1

What does "paramno" mean? What does "is_param" mean and, while I can desipher "param_type" easy enough, is there a key somewhere that gives you an idea as to what those numerical values mean?

Thanks!
0
Comment
Question by:brucegust
1 Comment
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 42021691
It's pretty well explained on the man page.  

As I understand it "paramno" is the positional offset (from zero) of the param in the query, however it will be -1 if this is not supported by the query type or the PDO extension in use.  The is_param=1 seems superfluous because why list anything that is not a param (d'oh)?

Param_type matches up with the PDO constants like PDO::PARAM_INT, PDO::PARAM_STR, etc.  See here:
http://php.net/manual/en/pdo.constants.php

Just a guess but the 21 in name=[21] ":screeningsubperiodid" is a character count

It's probably better implemented in this comment:
http://php.net/manual/en/pdostatement.debugdumpparams.php#113400

This is the sort of method that I alluded to when I suggested that you consider extending the PDO class.  It looks like it could be very helpful.

HTH, ~Ray
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

861 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