kevind
Posts: 251
|
| Posted: 02/01/2011, 5:50 PM |
|
I have a simple grid and record page which is includable.
The record has two text box fields which are free form text. I use a custom insert which simply grabs the values in the fields and also updates 1 field in the database from a URL value.
My problem is the single insert causes two records to get inserted into the mySQL database.
I have also tried dropping the custom insert set up and putting a hidden field in for the 3rd field value i'm trying to update.
has anyone seen this behaviour with ASP & mySQL - it's really odd, I am not see this in other record forms against other tables. I don't have any triggers in the mySQL database to cause this since I don't know how to code that yet.
thanks in advance for any help
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
kevind
Posts: 251
|
| Posted: 02/01/2011, 5:58 PM |
|
PS -- the record is inside a panel, though that shouldn't make a diff.
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
damian
Posts: 838
|
| Posted: 02/01/2011, 7:55 PM |
|
have you tested the insert query in a mysql client to make sure the query isnt faulty?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
kevind
Posts: 251
|
| Posted: 02/02/2011, 5:27 AM |
|
Quote damian:
have you tested the insert query in a mysql client to make sure the query isnt faulty?
there is no query - it is a CC record form, plain and simple
I also tried recreating the form - same behaviour.
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
damian
Posts: 838
|
| Posted: 02/03/2011, 4:01 PM |
|
of course there is a query - its just an insert or update query.... :)
you said you are doing a custom insert... can you switch vqb to sql view and see what the query is?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
kevind
Posts: 251
|
| Posted: 02/03/2011, 4:06 PM |
|
Quote damian:
of course there is a query - its just an insert or update query.... :)
you said you are doing a custom insert... can you switch vqb to sql view and see what the query is?
Thanks to all that replied.
I figured it out - it had nothing to do with the SQL or the record form settings. What I found was that if the record form was inside a panel (which I used to control visibility of the form) it would do a double insert.
Once I moved the record (with no modifications) outside the panel, it would work properly.
It still baffles me, I'm pretty sure I have used panels to hide record forms before without this behaviour.
Kevin
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
Oper
Posts: 1195
|
| Posted: 02/03/2011, 4:16 PM |
|
First make the form Visible=false
then Hide Panel.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
kevind
Posts: 251
|
| Posted: 02/03/2011, 4:20 PM |
|
Quote Oper:
First make the form Visible=false
then Hide Panel.
How does that prevent the system inserting 2 records into the database? This behaviour only happened when the form was inside the panel and it was visible.
When I wanted to hide the form based on user group of the logged in user, it worked. I could hide the panel & form inside it.
When I moved the record form outside the panel, it worked properly, inserting a single record as expected.
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |
datadoit
|
| Posted: 02/03/2011, 4:28 PM |
|
FYI, record forms can be hidden without the need to encase them in a panel.
|
|
|
 |
kevind
Posts: 251
|
| Posted: 02/18/2011, 1:08 PM |
|
Quote datadoit:
FYI, record forms can be hidden without the need to encase them in a panel.
I do the panel to enclose a few components - I'm pretty sure this has worked elsewhere without causing the double inserts, but I don't have time to investigate further - not my bug.
_________________
thanks
Kevin
======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
|
 |
 |