Solved

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

Posted on 2007-03-29
4
427 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

9 Experts available now in Live!

Get 1:1 Help Now