SQL Error on Insert
We've worked on this page before and the error has returned, nit sure why or how to fix it.
We've worked on this page before and the error has returned, nit sure why or how to fix it.
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:
$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.
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.
Your code resets the session before every page load... which means it is exactly the same as using the post.
You had:
$_SESSION['cont'] = $_POST['contact_name'];
I fixed it by changing it to:
if (isset($_POST['contact_name'])) $_SESSION['cont'] = $_POST['contact_name'];
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.