Solved

How to run a sql script using mysql & php to add an oscommerce paypal module

Posted on 2007-03-29
4
429 Views
Last Modified: 2013-11-18
Hello

I am trying to add a paypal pro module to a oscommerce cart.

Here are the instructions

------------------------------------------------------------------------
osCommerce PayPal Website Payments Pro, U.S. Edition

This module implements PayPal Website Payments Pro, including Direct Payment and Express Checkout, for the U.S.
Installation

To install this module, back up your existing installation to a safe place and then just copy the included catalog/ directory over your existing osCommerce files. This will replace the modified files and add the new files. However, if you have modified your osCommerce installation, you will need to manually compare the new files with your existing ones, and possible manually merge the changes.

If you are installing osCommerce for the first time, you can find installation instructions at http://www.oscommerce.info/kb/225, or http://www.oscommerce.info/kb/osCommerce/Installation_and_Upgrades/41 depending on your environment. You will need to turn on register_globals and enable the mysql extension in php.ini, at a minimum.

Once you have copied the files, you need to run a small SQL script. It is paypal_wpp.sql in this directory. The command to run it may vary depending on your database name and user, but will look something like:

mysql -u oscommerce -p oscommerce < paypal_wpp.sql

This assumes that your database user is named "oscommerce", and the name of the database is "oscommerce". You will be prompted for the database user's password.
------------------------------------------------------------------------

I have done all the coping and just need to know how to run the "small SQL script." I have the correct username and database name.

Do I run this in the Query Window of MyPHPAdmin of the database? I have zero knowledge of mysql and php but know enough to be dangerous with MSsql and Access.

Also here is the script in paypal_wpp.sql

------------------------------------------------------------------
ALTER TABLE `customers` ADD `customers_paypal_payerid` VARCHAR( 20 );
ALTER TABLE `customers` ADD `customers_paypal_ec` TINYINT (1) UNSIGNED DEFAULT '0' NOT NULL;
-------------------------------------------------------------------

Thanks for any help on this,

coma12
0
Comment
Question by:coma12
  • 2
4 Comments
 
LVL 24

Accepted Solution

by:
glcummins earned 500 total points
ID: 18819007
The following command:

   mysql -u oscommerce -p oscommerce < paypal_wpp.sql

is merely a command-line way to import the data in paypal_wpp.sql into your database. If you already have phpMyAdmin installed, you don't need to use the command. Just click on the Import tab, select the location of 'paypal_wpp.sql', and click "Go". This will import the data for you.
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 18819014
>>> Do I run this in the Query Window of MyPHPAdmin of the database?

That's exactly it.  You'll have to make sure you are logged in with a user account owning access to alter those tables.  
0
 
LVL 24

Expert Comment

by:glcummins
ID: 18819066
Careful there. You don't want to run 'mysql -u oscommerce -p oscommerce < paypal_wpp.sql' in the query window. That is not a query. The contents of the .sql file can be run in the query window, but not the command itself.
0
 
LVL 1

Author Comment

by:coma12
ID: 18819147
glcummins,

Thanks! It worked though I had to select the customers table then import the paypal_wpp.sql script into it.

coma12
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now