Is there any way to print the actual query that mysqli->execute() makes?

Posted by 0plus1 on Stack Overflow See other posts from Stack Overflow or by 0plus1
Published on 2010-04-22T14:31:28Z Indexed on 2010/04/22 14:33 UTC
Read the original article Hit count: 163

Filed under:
|

I have a complex query that gets executed like this:

if ($stmt = $dbi->prepare($pt_query)) {   
        $stmt->bind_param('ssssssssi', $snome,$scognome,$ssocieta,$svia,$slocalita,$sprovincia,$scap,$stelefono,$sfax,$uid);
        $stmt->execute();           
        echo $dbi->error;
        $stmt->close();

    } else {
        printf("Error -> %s\n", $dbi->error);
    }

This thing is failing without any error, it simply doesn't update the database. Since there is a ton of data that gets treated before this thing I would like to know if there is any way to show the actual query that mysqli is executing in order to understand where the problem is.

Thank you.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysqli