Forums

chronoform doesn't update database for second data

bramya 21 Oct, 2011
HI
I am using the chronoform v4 with text box,captcha,text area,selection box.Selection box is loaded by custom code from table and it inserts into form table.DB save action didn't work perfectly so,i gave insertion in custom code.

For first time,it updates correctly.But for second time its not updating in the table.

Give your suggestions as soon as possible
Thanks in advance,
GreyHead 21 Oct, 2011
Hi Bramya,

What is 'the second time'?

Bob
bramya 22 Oct, 2011
For first user that form updates all the details into the table.For second user, its not inserting into the database..
The form which i am using is not based on registration,anyone can access that.I am doing the registration from Same IP..(It may be problem i guess not sure)
Can u tell me a correct solution for that.
GreyHead 22 Oct, 2011
Hi bramya,

I'm sorry there just isn't enough information there for me to start to understand what you are doing or why it doesn't work.

Bob
bramya 22 Oct, 2011
Gave code to load the selection box from another database.foreach loop to load selection box
foreach ( $options as $o ) {
  echo "<option value='".$o[id]."'>".$o[name]."</option>";
}


Insert query for form table to insert all fields.Didn't use DB save action.
$query="INSERT INTO table(name,short_desc,category_id) VALUES
('$_POST[name]','$_POST[short_desc]','$_POST[category]')";

if that form is used for first time it inserts the data.second time it doesn't works..
Thanks in advance,
GreyHead 22 Oct, 2011
Hi Bramya,

if you are updating an existing record then your query needs to use UPDATE - INSERT is only for new records.

Bob
This topic is locked and no more replies can be posted.