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

Posted on 2007-03-29
Medium Priority
Last Modified: 2013-11-18

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.

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,

Question by:coma12
  • 2
LVL 24

Accepted Solution

glcummins earned 2000 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.
LVL 51

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

Expert Comment

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.

Author Comment

ID: 18819147

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


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
There are more than 1000 cryptocurrencies available across the world, but Bitcoin has gained a significant advantage over others. The cryptocurrencies are capitalizing the market with more than $150 billion dollars.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

600 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