close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

writing to the ecart database

Thread began 5/07/2011 8:45 am by admin140217 | Last modified 5/09/2011 4:05 pm by Jason Byrnes | 2263 views | 5 replies |

admin140217

writing to the ecart database

Okay, I'm probably just being stupid but I have set up a simple registration form using ecart 5 and can populate the form via the database, that works fine but I want to be able to write to the database for each registration made.

I don't work with databases that much but have done this before and have forgotten how.

Can someone point me in the right direction to start writing to the database instead of posting to it?

Thanks,

Sign in to reply to this post

admin140217

Working on it

I still haven't been able to figure out how to write the form info into a database when submitting the form. maybe I'm going about it wrong but I would normally do this to write to a database, this code is working right now as an action page locally:

<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("registration_db", $con);

$sql="INSERT INTO registrants (FirstName, LastName, City, State, Zip, Address, Address2, Phone, Email, Function)
VALUES('$_POST[FirstName]','$_POST[LastName]','$_POST[City]','$_POST[State]','$_POST[Zip]','$_POST[Address]','$_POST[Address2]','$_POST[Phone]','$_POST[Email]','$_POST[Function]')";

if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";

mysql_close($con)
?>

In the generated ecart form the action is already assigned using a PHP_SELF statement.

What I want to do is have the information write to the database but also continue on to the shopping cart display for confirmation, then to PayPal for payment.

so I guess I'm saying that the problem isn't writing to the database but integrating the above action into the ecart generated files.

Sign in to reply to this post

Jason ByrnesWebAssist

Use the eCart checkout wizard to create the checkout pages for you.

as long as you have a database connection configured before running the wizard, you will be able to configure the checkout pages to store the order information to the database within the wizard.

Sign in to reply to this post

admin140217

Thanks

Thanks Jason,

I think I was confused between the ecart object's add to cart function and checkout pages. I'll give it a try and see what happens.

Sign in to reply to this post

admin140217

It is writing to the database but

Okay, I see where it is writing to the database now in the orderdetails table. If I modify that table to include other fields will this automatically be generated when creating the checkout system? Or will I have to add the fields I want written to in the confirm.php page?

Sign in to reply to this post

Jason ByrnesWebAssist

If you add new fields you will need to edit the store order details server behavior to bind the new fields to the values.

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