clues for a clueless guy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #1

    clues for a clueless guy

    Hi,

    currently I'm stuck on finding the error of one of my functions. I try to read data out of MySQL using PDO. the SQL string is loaded as Prepared Statement (PDO->prepare()) and shall be executed using PDOStatement->execute().

    I already know:
    - there's no PDOException thrown
    - there's no Error message
    - the execute method returns false
    - the parameters are correctly passed
    (- all fields exist in the DB, they are either string types or int)

    anyone an idea where to look or how to get more details about the error?

    if I try it manually, it works…

    Code:
    			SELECT
    				`comment`,
    				`date`,
    				`email`,
    				`homepage`,
    				`icq`,
    				`id`,
    				`ip`,
    				`name`,
    				`text`,
    				`time`
    			FROM
    				`myphpgb_entries`
    			WHERE
    				`status` = ?
    			ORDER BY
    				`id` DESC
    			LIMIT
    				?,?
    Last edited by Dormilich; Apr 21 '09, 01:19 PM. Reason: result from another test
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it turned out, the last parameter (which was fetched from DB) had the wrong type. typecasting to int solved it.

    …what a pain with those types

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by Dormilich
      it turned out, the last parameter (which was fetched from DB) had the wrong type. typecasting to int solved it.

      …what a pain with those types
      Amen, brother :P

      It's strange that PDO didn't return an error..

      Comment

      Working...