Jump to content

display query just submitted by mysqli


chiprivers

Recommended Posts

Is it possible to echo the query just submitted using mysqli->execute();

 

I am having trouble with a prepared statement which I know is working fine because I can copy and paste it straight in, replacing the ? with the required values and it works.  I have echoed the $variables in my php script to ensure they are correct before carrying out the execute() but I am getting no rows returned.

 

I am just wondering if there is a method for returning the complete query as it was run to ensure it is correct?

Link to comment
Share on other sites

Are you testing the value (TRUE/FALSE) that $stmt->execute(); returns so that you know if the query is being executed or is producing an error?

 

You can also use $stmt->error to find out what error is occurring.

 

Beyond that it would take seeing your code to be able to help you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.