Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-13-2002 22:58:08

Guest
Guest

product upload to MYSQL

I tried to upload an text file to prodcut table using MYSQL "insert data from text file into table" function.  I use the product.csv file as sample and add couple new item. 

Every time I upload it, the error message says " Access denied for user: 'book@localhost' (Using password: YES)"

Can some one let me know why?  Or someone can show me how to do upload to the product table?

Thanks for help.

 

#2 08-14-2002 06:47:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product upload to MYSQL

That's a password problem with the application you're using to access MySQL.  Check with your host on this.  If you're using PHPMyAdmin, they've got your permissions set incorrectly for your MySQL account.


Nick Hendler

Offline

 

#3 08-14-2002 15:11:38

Guest
Guest

Re: product upload to MYSQL

Thanks for reply.

I wonder to upload product to MySQL table, is there other way to do it thrught the website by uploading a text file or I must go to MYSQL admin area to upload it?

is it right to use product.csv file as upload file format, it looks like that there is other signs defined in the MYSQL admin area for uploading file, such as field escape by...", "line terminated by rn". etc.

Anyway, any easiest way to uplaod thousands of product (books).


Another questions is if I add couple of more field in the database product talble, how can I modify script so that value in the added field can be shown correctly in product detail page, I add like "author, publisher, etc" field and trying to show these info on the product (book) pages?  And which script I should go?

Again thanks for help.  It is really a great product, but I am just not skilled enought to play around it.



 

#4 08-14-2002 15:16:19

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product upload to MYSQL

Using a program like PHPMyAdmin to get the info into MySQL is the most efficient way to do it.  Per the settings in the script, the defaults for our CSV files are:

Line Ending: rn
Seperator:   ,
Quote Char:  "

If you add fields to the product table, you're going to need to modify ./data/tables/config_product.csv to pick up on them.


Nick Hendler

Offline

 

#5 08-14-2002 16:39:59

Guest
Guest

Re: product upload to MYSQL

So do I use product.csv file as product upload template or any other files, or I need to create one by myself?

 

#6 08-14-2002 17:19:37

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product upload to MYSQL

I'd use product.csv - anything else will screw you up pretty bad.


Nick Hendler

Offline

 

#7 08-14-2002 17:27:29

Guest
Guest

Re: product upload to MYSQL

I am still waiting the server host to let me know anythong wrong with the access permission and after that, I will try to upload the file.

CCP 5 is pretty cool, I really like it, it is far much better than CCP 4.

Thanks for help.

 

#8 08-14-2002 21:07:59

Guest
Guest

Re: product upload to MYSQL

While the server is still strugling with the problem, I am thinking is it possible you modify the script so everytime, when change the product to mqsql from csv, the datao in product.csv file will add in product table in the mysql instead of overwriting?  If that is practicable, then I can use product.csv file and convert it into mysql database, and everytime, I can add in 5000 items, will that be a very easy way to add product into the database table?

If so, can you let me know which script I need to modify and how?

 

#9 08-15-2002 06:10:46

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product upload to MYSQL

You would need to modify the script ./cgi-bin/library/modules/adm_db.pl.  Just look for the $sql_statement that includes a DROP element and comment out the eval line behind it.  The will prevent the table drop and force the writing of new rows.  One thing, though - you've got to make sure your primary keys (product_id) are all unique, or MySQL will blow up along the way.


Nick Hendler

Offline

 

#10 08-15-2002 08:58:50

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product upload to MYSQL

Please don't paste a full routine like that onto the forum - it's a competitor's dream come true. 

(1) Do an export of one product so that the table gets created.

(2) Then, comment out the line:

eval {&database_call($tablename,'DROP',$sql_statement);};

and the line below it a bit:

&database_call($tablename,'CREATE',$sql_statement);

(3) Export your products a set at a time.

(4) Uncomment those lines.


Nick Hendler

Offline

 

Board footer