close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

MySQLi statements failing to execute

Thread began 1/15/2019 9:18 am by s.joiner74419001 | Last modified 1/24/2019 11:51 am by s.joiner74419001 | 74 views | 8 replies

Ray BorduinWebAssist

Please start new threads with new issues, so that users that might have the same problem can find them more easily and we don't dirty up threads with good questions and answers with unrelated issues.

I'm not sure how you would expect this page to work. You have a form with a single form element in it, but I don't think that form is ever submitted.

Did you want the value to be updated every time this page is accessed? Or did you have a link that adds the url parameter that triggers it?

My guess, without fully understanding the problem or what you are doing, is that you can fix the problem by:

1) deleting the form and hidden form element completely (it isn't doing anything)
2 updating this code:

php:
<?php

if (WA_Auth_RulePasses("submitted")) {
  
$UpdateQuery = new WA_MySQLi_Query($RTMFi);
  
$UpdateQuery->Action "update";
  
$UpdateQuery->Table "enq_details";
  
$UpdateQuery->bindColumn("estimated_fee""s""".((isset($_POST["total_cost"]))?$_POST["total_cost"]:"")  ."""WA_DEFAULT");
  
$UpdateQuery->addFilter("enq_det_id""=""i""".$_SESSION['enquiryDetID']  ."");
  
$UpdateQuery->execute();
  
$UpdateGoTo "enquiry-list.php?redirect=yes";
  if (
function_exists("rel2abs")) $UpdateGoTo $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
  
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$totalCost 
= ($rsCalculate->getColumnVal('no_of_flats') * 75) + ($rsCalculate->getColumnVal('no_of_blocks') * 500);
?>



to:

php:
<?php

$totalCost 
= ($rsCalculate->getColumnVal('no_of_flats') * 75) + ($rsCalculate->getColumnVal('no_of_blocks') * 500);
?>
<?php
if (WA_Auth_RulePasses("submitted")) {
  
$UpdateQuery = new WA_MySQLi_Query($RTMFi);
  
$UpdateQuery->Action "update";
  
$UpdateQuery->Table "enq_details";
  
$UpdateQuery->bindColumn("estimated_fee""s""".($totalCost)  ."""WA_DEFAULT");
  
$UpdateQuery->addFilter("enq_det_id""=""i""".$_SESSION['enquiryDetID']  ."");
  
$UpdateQuery->execute();
  
$UpdateGoTo "enquiry-list.php?redirect=yes";
  if (
function_exists("rel2abs")) $UpdateGoTo $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
  
$UpdateQuery->redirect($UpdateGoTo);
}
?>



There is no need to use a hidden field or form at all, you can update the table with the calculation directly once you do the calculation above the update code.

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...