PDA

View Full Version : How to update the database!


omegaman66
6-9-07, 02:15 AM
I have installed osCommerce successfully. I have to prepare it for paypals Website Payment Pro. I have uploaded all the new files so that part is done. But I need to fix the database to handle this!

Two sql files were part of the package. How do I do this?

Here is the contents of one of the files.
ALTER TABLE `customers` ADD `customers_paypal_payerid` VARCHAR( 20 );
ALTER TABLE `customers` ADD `customers_paypal_ec` TINYINT (1) UNSIGNED DEFAULT '0' NOT NULL;
Here is the contents of the second file.
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Purchase without account', 'PURCHASE_WITHOUT_ACCOUNT', 'yes', 'Do you allow customers to purchase without an account?', '5', '10', 'tep_cfg_select_option(array(\'yes\', \'no\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Purchase without account shippingaddress', 'PURCHASE_WITHOUT_ACCOUNT_SEPARATE_SHIPPING', 'yes', 'Do you allow customers without account to create separately shipping address?', '5', '11', 'tep_cfg_select_option(array(\'yes\', \'no\'), ', now());

Would like a little guidance before I mess up the database!


PS:
Install help says:
Once you have copied the files, you need to run two small SQL scripts, paypal_wpp.sql and pwa.sql, both in this directory. The command to run them may vary depending on your database name and user, but will look something like:

mysql -u oscommerce -p oscommerce < paypal_wpp.sql
mysql -u oscommerce -p oscommerce < pwa.sql

How do I run these commands?? Do I simply type in the path to these files and execture them? How would it know which database to modify??? ex: wwx.mysite.con/paypal_wpp.sql

HalfaBee
6-9-07, 04:17 AM
First thing to do is BACKUP.

The run the sql, this can be done easily in phpmyadmin.
Just select the db and use the SQL tab.

omegaman66
6-9-07, 05:10 AM
I have gone into phpmyadmin selected the database but don't know what to do from there!

omegaman66
6-9-07, 10:12 AM
Oh you mean you want me to do what you say.... duh.

OK I did what you said but I am getting a syntax error

mysql - u username - p databasename < paypal_wpp.sql

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u xxxxxxx -p xxxxxxx < paypal_wpp.sql' at line 1

omegaman66
6-9-07, 01:24 PM
ARGGGG Can't figure out this syntax issue.

mysql -u username -p dbname < /home/users/web/bXXXX/pow.XXXXXXX/htdocs/paypal_wpp.sql

Does this look right. I had blanks between the - and the u at first because that is what the documentation shows. I tried no path at first because that is what the documentation showed but now I think that is wrong but still can't get it to work. Is the a blank space between the < and /home??? Tried in the estore folder and the root as shown above with the proper files copied to both of those folders but keep getting a freakin syntax error.

Hair almost gone. fyi

omegaman66
6-9-07, 05:44 PM
Figured it out I believe. Didn't use the command line. Used the import to use the file directly from my computer.