Solved

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dynamic varibles 5 34
php checkbox validation 5 27
How to update the value of duplicated records (except latest one) 2 20
does post require a form or curl to be post 4 35
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

821 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