close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

debugging mysqli insert query

Thread began 7/14/2019 11:58 pm by CraigR | Last modified 7/19/2019 5:44 am by CraigR | 1424 views | 6 replies

CraigRBeta Tester

debugging mysqli insert query

i have a site which has been working fine until recently, but some errors are coming to light after the host updated to a newer version of mySQL

one issue I have encountered is an insert query, which populates a table if certain criteria are met, however I am unable to check the insert statement.

here is my code

php:
<?php

if (isset($_POST["Create"]) && isset($campaignid)) {
    
    
$new_invitees array_diff($_SESSION['memberidsinmailing'],$already_invited); 
    
//compare the 2 arrays, and return the member id's who are in the campaign send list, but have not already received an invitation
    //the members already sent will get another email, but they will not get a new entry in the tbleventmember table

    
foreach ($new_invitees as $invitedmember) {
      
$InsertQuery = new WA_MySQLi_Query($PowerCMSConnection_i);
      
$InsertQuery->Action "insert";
      
$InsertQuery->Table "tbleventmember";
      
$InsertQuery->bindColumn("EventID""i""".isset($_GET['EventID'])?$_GET['EventID']:''."""WA_DEFAULT");
      
$InsertQuery->bindColumn("MemberID""i""".$invitedmember."""WA_DEFAULT");
      
$InsertQuery->bindColumn("InviteSent""i""0""WA_DEFAULT");
      
$InsertQuery->bindColumn("CampaignID""s""".$campaignid."""WA_DEFAULT");
      
$InsertQuery->saveInSession("eventmember");
      
$InsertQuery->execute();
      
$InsertGoTo "";
      if (
function_exists("rel2abs")) $InsertGoTo $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
      
$InsertQuery->redirect($InsertGoTo);
    }
}
?>



in order to try and debug, i added some statement on $_POST["Create"]

php:
echo $InsertQuery->debugSQL();



but the page returns an error

Fatal error: Call to a member function debugSQL() on null

if i run the debugSQL() function on a recordset from a SELECT statement with a which is also on the page, i get the expected output.

I have set $this->Debug = true; in both rsobj.php (version 2.18) and queryobj.php (version 1.5)

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...