close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi generates faulty code

Thread began 2/11/2015 9:44 am by malcolm230194 | Last modified 2/16/2015 4:19 am by malcolm230194 | 2171 views | 6 replies |

malcolm230194

MySQLi generates faulty code

I've been finding that MySQLi generates errors and I'm having to go in and edit the generated code. Sometimes there is a duplication of part of the code giving the value from validated fields and sometimes the " character is randomly escaped as below.

$UpdateQuery->bindColumn("UserAddress1", "s", "".((isset($_POST["address1"]))?$_POST["address1"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserAddress2", "s", "".((isset($_POST["address2"]))?$_POST["address2"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserCity", "s", "".((isset($_POST[\"city\"]))?$_POST[\"city\"]:\"\") .\"", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserState", "s", "".((isset($_POST[\"state\"]))?$_POST[\"state\"]:\"\") .\"", "WA_DEFAULT");

Have you any ideas regarding the source of this problem?

Malcolm

Sign in to reply to this post

Jason ByrnesWebAssist

I am not able to reproduce.

What is your OS?

What version of DW are you using?

What Version of MySQLi are you using?

are you always using the signing bolt icon / bindings panel to select the form bindings? or hand coding some of them.

Sign in to reply to this post

malcolm230194

MySQLi problem

OS is Win 7

DW is CS6 Ver12.0 Build 5808

MySQLi is Version 1.0.3

Yes I always use the lightning bolt and only hand code to remove errors.

I've just tried to edit an update server behaviour to test and have had the following sequence of events.

The MySQLi Update record window appears with a succession of error windows with a message

'It appears that one of your server-side values is improperly coded. Please check this interface for inconsistencies.'

The previously correct code is escaped starting at the fourth field.

Code fragment below is after correcting corrupted code using lightning bolt which just makes it worse.


$UpdateQuery->bindColumn("UserAddress1", "s", "".((isset($_POST["address1"]))?$_POST["address1"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserAddress2", "s", "".((isset($_POST["address2"]))?$_POST["address2"]:"") ."", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserCity", "s", "".((isset($_POST["city"]))?$_POST["city"]:"") ."?$_POST[\"city\"]:\"\") .\"", "WA_DEFAULT");
$UpdateQuery->bindColumn("UserState", "s", "".((isset($_POST["state"]))?$_POST["state"]:"") ."?$_POST[\"state\"]:\"\") .\"", "WA_DEFAULT");

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the page please.

Sign in to reply to this post

malcolm230194

MySQLi generates faulty code

File attached

Sign in to reply to this post

Jason ByrnesWebAssist

yeah the problem is triggered by using the validated entries binding.

I think if you delete the column bidding that use the validated entries bindings, so in the page you have sent that will be lines 97 - 107:
$ConditionalQuery->bindColumn("OrderShipAddress1", "s", "".(ValidatedField("confirmiframe_562","shipAddress1")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipAddress2", "s", "".(ValidatedField("confirmiframe_562","shipAddress2")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipCity", "s", "".(ValidatedField("confirmiframe_562","shipCity")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipState", "s", "".(ValidatedField("confirmiframe_562","shipState")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipZip", "s", "".(ValidatedField("confirmiframe_562","shipPostcode")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipFirstName", "s", "".(ValidatedField("confirmiframe_562","shipFirstName")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipLastName", "s", "".(ValidatedField("confirmiframe_562","shipLastName")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipPhone", "s", "".(ValidatedField("confirmiframe_562","shipPhone")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipEmail", "s", "".(ValidatedField("confirmiframe_562","shipEmail")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipCountry", "s", "".(ValidatedField("confirmiframe_562","shipCountry")) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderComments", "s", "".(ValidatedField("confirmiframe_562","comments")) ."", "WA_DEFAULT");


then open the server behavior to edit it, and reselect the form elements, it should work correctly.

Sign in to reply to this post

malcolm230194

MySQLi problem

This post has been deleted.

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