How to print parmeterized query for debugging

Discussion in 'PHP' started by greatlogix, Mar 1, 2011.

  1. #1
    
    $linksQuery = $dbase->prepare("SELECT * from mytable WHERE  mycolumn = ? order by mycolumn");
    	$linksQuery->execute(array('1'));
    
    PHP:
    for debugging i want to print query like this SELECT * from mytable WHERE mycolumn = 1 order by mycolumn

    Is it possible to get complete query using PDO?
     
    greatlogix, Mar 1, 2011 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    $linksQuery->queryString
     
    tvoodoo, Mar 1, 2011 IP
    greatlogix likes this.
  3. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #3
    Thanks for your help. Its printing "SELECT * from mytable WHERE mycolumn = ? order by mycolumn"
    Is it possible to get ? replaced with value 1?
     
    greatlogix, Mar 2, 2011 IP