close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SQL Error on Insert

Thread began 10/17/2018 6:05 am by vernon webb | Last modified 10/18/2018 10:35 am by Ray Borduin | 846 views | 4 replies |

vernon webb

SQL Error on Insert

We've worked on this page before and the error has returned, nit sure why or how to fix it.

Sign in to reply to this post

Ray BorduinWebAssist

You can turn on debug mode in your rsobj.php file and it will give you the full error. The issue was that you had code:

php:
$rsCLIENTNAME->setQuery("SELECT * FROM customers_address_book, customers WHERE customers_address_book.id = $cont AND customers_address_book.customer_id = customers.customers_id");



But your variable $cont is set on the top of the page with:
$cont = $_POST['contact_name'];

The submit of this page doesn't include the 'contact_name' form element, so once the page resubmits the code fails. The solution might be to just add a hidden form element named "contact_name" set to the previously submitted value so that it carries through to the next post.

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

vernon webb

I changed it to a session, that should have worked no? I still have the SQL syntax error. Also I set the Debug to true and it didn't help.

Sign in to reply to this post

Ray BorduinWebAssist

Your code resets the session before every page load... which means it is exactly the same as using the post.

You had:

php:
$_SESSION['cont'] = $_POST['contact_name'];



I fixed it by changing it to:

php:
if (isset($_POST['contact_name'])) $_SESSION['cont'] = $_POST['contact_name'];
Sign in to reply to this post
Did this help? Tips are appreciated...

vernon webb

Thank you sir

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