close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Is there a Success or Error method in the insert/update behaviours

Thread began 7/03/2017 4:21 am by Dave Buchholz | Last modified 7/13/2017 8:12 am by Ray Borduin | 1008 views | 5 replies |

Dave BuchholzBeta Tester

Is there a Success or Error method in the insert/update behaviours

To give this some context, if I was hand coding an insert I would do something like

$insertSQL = ("INSERT INTO tbl_sometable (field1, feild2) SELECT field1,field2 FROM anothertable WHERE ID = $ID;
if(!($insertSQL)){
die('<h3>Error: Process Terminated </h3><p>Problem occurred with $insertSQL ('. $connMySQLi->errno .') ' . $connMySQLi->error . '</p>');
}



Is something like this available with your SB's ?

Thanks,

Dave Buchholz
I-CRE8 Limited

Sign in to reply to this post

Dave BuchholzBeta Tester

ok, so a bit more sleuthing reveals that you have a ErrorNo field returned in the object like so


WA_MySQLi_Query Object
(
[Action] => update
[UseAction] => update
[AffectedRows] => 0
[Connection] => mysqli Object
(
[affected_rows] => -1
[client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
[client_version] => 50011
[connect_errno] => 0
[connect_error] =>
[errno] => 0
[error] =>
[error_list] => Array
(
)

[field_count] => 0
[host_info] => Localhost via UNIX socket
[info] => Rows matched: 1 Changed: 0 Warnings: 0
[insert_id] => 0
[server_info] => 5.6.35
[server_version] => 50635
[stat] => Uptime: 359 Threads: 1 Questions: 633 Slow queries: 0 Opens: 69 Flush tables: 1 Open tables: 62 Queries per second avg: 1.763
[sqlstate] => 00000
[protocol_version] => 10
[thread_id] => 9
[warning_count] => 0
)

[Debug] => 1
[Error] =>
[ErrorNo] => 0
[FieldCount] => 0
[Filter] =>
[FilterValues] => Array
(
[0] => Array
(
[0] => SKU
[1] => =
[2] => s
[3] => JGB635DEKBB
[4] =>
[5] =>
)

[1] => Array
(
[0] => storeID
[1] => =
[2] => i
[3] => 2
[4] =>
[5] =>
)

)

[ID] => 3
[InsertID] => 0
[NumRows] => 0
[ParamColumns] => Array
(
[0] => Array
(
[0] => sell_code
[1] =>
)

[1] => Array
(
[0] => store_SKU
[1] =>
)

[2] => Array
(
[0] => tstampupdate
[1] =>
)

[3] => Array
(
[0] => dateupdate
[1] =>
)

[4] => Array
(
[0] => adminupdate
[1] =>
)

)

[ParamCount] => 6
[ParamDefaults] => Array
(
[0] => WA_IGNORE
[1] => WA_IGNORE
[2] => WA_DEFAULT
[3] => WA_DEFAULT
[4] => WA_DEFAULT
[5] =>
[6] =>
)

[ParamTypes] => Array
(
[0] => s
[1] => s
[2] => i
[3] => s
[4] => i
[5] => s
[6] => i
)

[ParamValues] => Array
(
[0] =>
[1] => 741
[2] => 1499078976
[3] => 2017-07-03
[4] => 7
[5] => JGB635DEKBB
[6] => 2
)

[RelationalColumns] => Array
(
)

[RelationalRows] => Array
(
)

[RelationalRowsFound] =>
[RepeatConditions] => Array
(
)

[RepeatedParams] => Array
(
)

[RepeatIndex] => 2
[Statement] => UPDATE tbl_store_models_info SET `store_SKU` = ?, `tstampupdate` = ?, `dateupdate` = ?, `adminupdate` = ? WHERE `SKU` = ? AND `storeID` = ?
[SaveAs] =>
[Table] => tbl_store_models_info
)



Can I just do a check if the value returned is greater than zero to detect an error ?

Sign in to reply to this post

Ray BorduinWebAssist

Yes that should work. I'd be weary about showing the error message since it might contain information about your database structure you don't want revealed.

Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

Thanks Ray, I have been experimenting some more in the mean time and it would seem that whenever there is an error you never see the ErrorNo returned as the process dies with a MySQL error if that makes sense.

Sign in to reply to this post

Ray BorduinWebAssist

Can you give me a sample page (ftp, url, and steps to reproduce)? I can take a look and see if there are adjustments that need to be made in the library file.

Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

Ray, I will put an example together but it might be a few days before I get round to it.

Thanks.

Sign in to reply to this post

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