Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

osCommerce using PHPMyAdmin help


webb_worx

Recommended Posts

Hi there,

Yesterday I finally started to get the hang of using the admin catalog area of my online store in osCommerce and spent the whole day inputing entries, but I got too ahead of myself and went into PHPMyAdmin and selected to 'drop' the product field 'products_date_added' thinking it would just delete the text on each page saying what date the product was added to the catalog.....big mistake.... Now my product detail pages are not showing correctly and instead I get this

 

1054 - Unknown column 'p.products_date_added' in 'order clause'

 

select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit 4

 

[TEP STOP]

 

I don't know PHP and I really need to fix this asap to continue on. :'(

Any help to get my pages back functioning would be great help.

Visit My Website

 

Thanks,

Brooke

Link to comment
Share on other sites

First, back up your database just to be sure things don't get worse.

 

Then go to phpmyadmin and select your database.

 

Scroll down and select the table called products.

 

Click on the structure tab in the right pane.

 

At the bottom, look for the section to create a new field.

 

Make a new field called products_date_added, type DATETIME, not null, with a default value of 0000-00-00 00:00:00

 

After you save it, make a new index called idx_products_date_added on the products_date_added field.

 

That should bring the field back, but I don't know what the effect of not having a real date and time for your current products will be.

 

Hope this works.

 

Ed

Link to comment
Share on other sites

Thankyou so much for your reply Ed will get onto it right away, only thing is the Database backup manager in oscommerce is comming back with the error

Error: Backup directory does not exist. Please set this in configure.php.

 

 

 

 

First, back up your database just to be sure things don't get worse.

 

Then go to phpmyadmin and select your database.

 

Scroll down and select the table called products.

 

Click on the structure tab in the right pane.

 

At the bottom, look for the section to create a new field.

 

Make a new field called products_date_added, type DATETIME, not null, with a default value of 0000-00-00 00:00:00

 

After you save it, make a new index called idx_products_date_added on the products_date_added field.

 

That should bring the field back, but I don't know what the effect of not having a real date and time for your current products will be.

 

Hope this works.

 

Ed

Link to comment
Share on other sites

Thankyou so much for your reply Ed will get onto it right away, only thing is the Database backup manager in oscommerce is comming back with the error

Error: Backup directory does not exist. Please set this in configure.php.

 

 

Well, I'm not sure what the consensus is on where the best place is to do this, but you could create a directory under your admin folder called backups, and then set your admin/configure.php file to point to that directory.

hint: define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

Then your backup should work, provided your database is small.

 

Ed

Link to comment
Share on other sites

O.K. so since I'm extremely new to php, how or where do I open the configure.php file and set up the Backup Directory to reflect: /home/elecinfo/public_html/osc/admin/backups/

 

I found the configure.php file in my admin folder but can't open it to edit it? What program should I be using to edit the file?

Link to comment
Share on other sites

So dreamweaver does open the php files but you have to open it from the file menu, got that part....

So do i just add /home/elecinfo/public_html/osc/admin/backups/ in between the speech commas where it says backups/ in the define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

Link to comment
Share on other sites

O.K. so since I'm extremely new to php, how or where do I open the configure.php file and set up the Backup Directory to reflect: /home/elecinfo/public_html/osc/admin/backups/

 

I found the configure.php file in my admin folder but can't open it to edit it? What program should I be using to edit the file?

 

Get yourself an ftp program, I think a lot of people here recommend File Zilla or something like that. I like 3d-ftp myself. Just google to find those free programs and download one of them. With a good ftp program, you can log on to you website and edit files, add directories, change permissions, etc easily. I think you can do some of these things in the file manager of oscommerce, but I'm not sure that works reliably on every website because of various operating systems and versions, so be careful if you try to edit any files using the file manager.

 

I'm leaving out some detail here, you'll have to figure out any missing steps or hope someone else jumps in here.

 

Ed

Link to comment
Share on other sites

Well finally got the configure.php file sorted seems I didn't need to edit the configure.php file just had to create the folder backups under admin folder and am good to go once I changed the permissions to write. Very happy thanks again Ed. Now to tackle the new field in PHPMyAdmin.

Link to comment
Share on other sites

Done. My pages are operating again, it just says This product was added to our catalog on . without the date. Anyone know how to get rid of this date text string as this is initially what i was trying to do before stuffing it all up?

Link to comment
Share on other sites

Done. My pages are operating again, it just says This product was added to our catalog on . without the date. Anyone know how to get rid of this date text string as this is initially what i was trying to do before stuffing it all up?

 

You might want to test this by adding a product to see what happens. I don't know what the effects will be of there being no record for existing products so test carefully before moving forward with these changes.

 

As for getting rid of the text, you can go to Tools-Define Languages and select the product_info.php language file and edit out the text between the quote marks.

 

Or you can go into the catalog/product_info.php and comment out the line that displays the text. It's probably something like echo TEXT_DATE_ADDED; or something similar.

 

Ed

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...