# php mysql oscommerce beginner advice suggestions



## shoff (Nov 13, 1999)

I have an operational web store that uses oscommerce. My store has been operational for several years. Most of the time, everything works as it should. There are a few tweeks I would like to make, but I have no way to test anything that involves the PHP code, except to make the change live and see if it works.

So I did that yesterday and I messed something up and have NO IDEA how to fix it. It isn't a matter of just going back to the previous status, because I added three products that show up in one area of the database table *products_id*, but are not showing up in at least two other views: database table *product_description*, nor do they show up in my online store OsCommerce Administration: admin/categories.php?cPath=38&pID=XXXX

I am not a programmer by any stretch. Is this a good forum to get help for this type of situation? If not, can you recommend another trusted free forum similar to this one where I can get help in a everyday common sense format. I am totally lost when I go to the OSCommerce support site or to the PHPMyAdmin support site or the MYSql support site. They seem to cater to the GeekSpeak techies.

Please advise or refer. Thank you so very much.


----------



## JiminSA (Dec 15, 2011)

> I have no way to test anything that involves the PHP code, except to make the change live and see if it works.


Download a local server (I use xampp), which will allow you to test php on localhost on your desktop/laptop etc.,,


----------



## JiminSA (Dec 15, 2011)

> Is this a good forum to get help for this type of situation?


We think so!
What tools do you use to update your database?(phpMyAdmin?) I suggest that you also download Notepad++ (it's a free script editor) and Filezilla (FTP handler) for your amended script uploads. (both freely available - Google and download...)
We would also like to see the script(s) where your products should (but don't) display...
... In the interrim maybe you can give us a link to your site?


----------



## shoff (Nov 13, 1999)

JiminSA said:


> Download a local server (I use xampp), which will allow you to test php on localhost on your desktop/laptop etc.,,


Thank you so much for your reply.
Where do you recommend I locate this local server? Should I create a new folder in my C drive? I am leary of servers, can you tell? There are 2 choices:

1.8.2 / PHP 5.4.25 What's Included? md5 sha1 (Download) (32 bit) 107 Mb

and

1.8.3 / PHP 5.5.9 What's Included? md5 sha1 (Download) (32 bit) 125 Mb

Which of these choices should I select?
Please advise.


----------



## JiminSA (Dec 15, 2011)

The first and latest PHP version, shoff.


----------



## JiminSA (Dec 15, 2011)

woops! and it sits on C: as per install.exe...


----------



## shoff (Nov 13, 1999)

JiminSA said:


> We think so!
> What tools do you use to update your database?(phpMyAdmin?) I suggest that you also download Notepad++ (it's a free script editor) and Filezilla (FTP handler) for your amended script uploads. (both freely available - Google and download...)
> We would also like to see the script(s) where your products should (but don't) display...
> ... In the interrim maybe you can give us a link to your site?


What tools do you use to update your database?
I normally add to my database using the editing functions in OSCommerce administration tool. It is easy to add new items that way, albeit a bit time consuming. Rarely, I use phpMyAdmin. (That is how I got into trouble this time).

I suggest that you also download Notepad++ (it's a free script editor) - I will do that tomorrow, (I am going to bed after I send this reply).

I suggest that you also download .... Filezilla (FTP handler)
I have an FTP handler that I have been using regularly for several years: CoffeeCup Direct FTP. It is easy, fast and I am very comfortable with it. Is there any reason I should not use that one?

We would also like to see the script(s) where your products should (but don't) display...I will do that tomorrow also

In the interrim maybe you can give us a link to your site? 
Sure : http://doortothenet.com/catalog/

After I get the 3 problem products fixed, perhaps we could work on the tweeks I need. I don't know if it would make sense to explain the tweeks needed in advance of getting the products fixed or not, in case the issues are related in any way. Let me know if you do want the other problems explained in advance of continuing. I will check back in the morning after I get some sleep and can work with a fresh mind.

Thanks again


----------



## JiminSA (Dec 15, 2011)

> I have an FTP handler that I have been using regularly for several years:


 carry on with what you obviously like (Filezilla was just a suggestion in case your FTP was being handled by a 3rd party)


> I normally add to my database using the editing functions in OSCommerce administration tool


this may prove to be disadvantageous, as I suspect that the problem lies with MySQL having been deprecated (prepared for obsolescence) and your db updater may not be using either of the two alternatives (MySQLi or PDO)


> Let me know if you do want the other problems explained in advance of continuing.


...no, let's let sleeping dogs lie for now


----------



## shoff (Nov 13, 1999)

Ok, I have downloaded and installed Notepad++ and XAMPP.
I do not know how to find the "script?" that you asked for, so I am including images of where I am seeing or NOT seeing the problem products.
Hopefully this will help or at least mayhaps you can guide me from there as to how to find the script.
==================
Image 1 is OSCommerceShowingFilesB4AndAfter1567-8-9 and is the view of the OsCommerce editing view showing where the missing files should be. * I created 10 "copies" of 1560 in PHPMyAdmin. 1561-1566 and 1570 showed up fine, but 1567, 1568, and 1569 only partially worked.
*The browser address shows: https://mysql1302.opentransfer.com/...arget=&token=2d47e5b8e965f9965f4e3694e8c29120








==================
Image 2 is products_idShowing1567-8-9.jpg. This view shows the 3 problem rows in PHPMyAdmin - this is the only view where I am able to see them.
The browser address of this view shows: https://mysql1302.opentransfer.com/...arget=&token=2d47e5b8e965f9965f4e3694e8c29120








==================
Image 3 is 1567whereIsThis.jpg. This view shows item number 1567 as an individual item in PHPMyAdmin edit mode. I included only one item as an example - let me know if you also need 1568 and 1569 in this manner.
The browser address of this view shows: https://mysql1302.opentransfer.com/...arget=&token=2d47e5b8e965f9965f4e3694e8c29120








==================
Image 4 is products_descriptionMissing1567-8-9.jpg This view shows the product_description table where the 3 problem items do NOT show up.
The browser address of this view shows: https://mysql1302.opentransfer.com/...arget=&token=2d47e5b8e965f9965f4e3694e8c29120








==================

I hope I have included enough information. Please let me know if or how I can provide any additional data to help you to help me.
Thank you again for your time and effort. Believe me when I say it is VERY MUCH Appreciated!


----------



## JiminSA (Dec 15, 2011)

Thanks shoff for such a detailed view of the db and osCommerce situation:up:


> I normally add to my database using the editing functions in OSCommerce administration tool. It is easy to add new items that way, albeit a bit time consuming. Rarely, I use phpMyAdmin. (That is how I got into trouble this time).


It seems to me that by bypassing the osCommerce add a product procedure and doing it direct via phpMyAdmin, that there are tables in your db which have not been updated (e.g. product_description).
The Solution: using phpMyAdmin, delete the three records you created manually (1567, 8, 9) and then insert them via osCommerce. This to ensure that all db entries are performed in order to include them accurately in the web page(s)


> Hopefully this will help or at least mayhaps you can guide me from there as to how to find the script.


It seems to me that your script will be in the Templates section of osCommerce. We should not need to look at them for the current problem, but may have to later, for your "Tweaks". Just open up the Template section and see if it supplies you with a directory of your website? When you mentioned that you used CoffeeCup Direct FTP, I assumed (incorrectly) that you had this website directory on your hard drive.
The "Tweaks" mentioned earlier may or may not require us to have it so (i.e. on your hard drive).


----------



## shoff (Nov 13, 1999)

> The Solution: using phpMyAdmin, delete the three records you created manually (1567, 8, 9) and then insert them via osCommerce


Ok, I deleted the problem rows wherever I could find them in the phpMyAdmin views. Unfortunately when I try to add a new item in the OSCommerce editor, it doesn't recognize the deletion, that is to say, the indexer continues on from whatever the last added assigned number was instead of recognizing the deletion and allowing a re-issue of the deleted rows. I went back to phpMyAdmin and deleted all rows after 1566 - so that 1566 should be the last item indexed. Logically, any new entry should see the last indexed row as 1566 and when adding a new item should re-use number 1567, 8, 9 and so on. But it isn't working that way. When I try to add a new item in OSCommerce, it continues on as though I have never deleted any items from the database. It seems to me that there should be a way to override the AUTOINCREMENT to reset the feature to a specific NEXT number. I suppose could continue on using the database and just keep track of the "Missing numbers" as a gap in the ordered sequence of products, but I am uncomfortable doing that at this point, just because there may be some errant pieces of those entries lurking somewhere in the database waiting to cause issues down the road. So I am baffled.



> It seems to me that your script will be in the Templates section of osCommerce. We should not need to look at them for the current problem, but may have to later, for your "Tweaks". Just open up the Template section and see if it supplies you with a directory of your website? When you mentioned that you used CoffeeCup Direct FTP, I assumed (incorrectly) that you had this website directory on your hard drive.
> The "Tweaks" mentioned earlier may or may not require us to have it so (i.e. on your hard drive).


The template "Directory" in OSCommerce has 3 entries NONE of which are in use. 
All 3 of them provide ONLY a choice to "INSTALL" . I do have a File Manager in OSCommerce which provides me with a directory of my website. However, it does NOT include the database in the File Manager, so I don't know how much help that will be. I believe most, if not all of my problems are related to the database.

ALL of my OSCommerce files are on my hard drive and I have uploaded them to my WebSpace provider. The MySQL database is hosted on my WebSpace providers server and I access it through my providers Control panel using phpMyAdmin. They give me backup options which allow me to save a backup of the database on my hard drive (which I have done, though not regularly enough, I should probably do it daily, especially if I am going to mess with the database - wow, MY SO BAD!!!) 
So this is where I stand.


----------



## JiminSA (Dec 15, 2011)

> there should be a way to override the AUTOINCREMENT


if you check the Operations tab in phpMyAdmin, you will see where you can edit the autoindex value - just make sure it is reset correctly when you have added your 3 products (i.e. to the next to be used id)...


> I do have a File Manager in OSCommerce


could you look for a file called index.php and report back?


----------



## JiminSA (Dec 15, 2011)

> mess with the database - wow, MY SO BAD!!!)


It's your database, shoff, to do with as you wish!


----------



## shoff (Nov 13, 1999)

JiminSA said:


> if you check the Operations tab in phpMyAdmin, you will see where you can edit the autoindex value - just make sure it is reset correctly when you have added your 3 products (i.e. to the next to be used id)...could you look for a file called index.php and report back?


=====================
K, I checked out the "Operations" tab in phpMyAdmin , saw the autoincrement box but I don't see a "change" option. It shows only 'create database' or 'copy database' options so I left it alone. Need further guidance here to find a 'change' option.
=====================
As for your request to


> look for a file called index.php


 - - there are LOTS of index.php files in my OSCommerce file directory. Actually I have all of them on my hard drive as well. There are two main directories in OSCommerce: admin and catalog. Then each of those has its own index.php plus several directories. Within several of those directories are additional index.php files NONE of which are identical. 
Having worked with my OSCommerce store for several years now, I know that the interaction of the database with all of the files in the directories is very complex and way beyond my abilities to master. Very simply, it is like a Spreadsheet with hundreds of nesting formulae referencing multiple databases and links. One little tiny misstep renders the entire thing non-operational. There are a few places I have been able to follow all of the links and make changes myself, but the tweeks I need are beyond my scope of understanding of the file/database interaction.


----------



## JiminSA (Dec 15, 2011)

> K, I checked out the "Operations" tab in phpMyAdmin , saw the autoincrement box but I don't see a "change" option.


Yes it doesn't really look changeable now that you mention it, but it is ... simply click on the "AUTO_INCREMENT" (next to be used) number (in your case it probably reads 1572, no?) and change it to 1567.
Then click the "GO" which does the change.
Then go to osCommerce and add those 3 products 1567, 8, 9.
Then go back and reset the next to be used figure back to 1572.
Products 1570 and 1571 should be intact and 1567-9 installed correctly.


> There are a few places I have been able to follow all of the links and make changes myself, but the tweeks I need are beyond my scope of understanding of the file/database interaction.


as I said earlier, let sleeping dogs lie, but the time is fast approaching when we need to give the dog a kick in the butt... Let's get these products sorted, first.


----------



## JiminSA (Dec 15, 2011)

N.B. Make a Backup before attempting the changes ...


----------



## shoff (Nov 13, 1999)

Thank you very much for your suggestions.

You know, I have tried and tried to figure this out and it just isn't giving me any options for turning the auto_increment on or off and putting in a number or value. I am including a print screen of what I am seeing in hopes that it will help you to direct me further.
This is what I get when I click on the operations tab at the main database location in phpMyAdmin:








I don't want to "copy the database", nor to I want to "create a database before copying" but I see no other option. If this is the only option, I guess I will just have to live with the "missing numbers".


----------



## JiminSA (Dec 15, 2011)

The all important "Table Options" Panel is not an option on your particular server's phpMyAdmin package. It really must be in order to do what we need to do. But all is not lost, I suggest you raise a Support Ticket with your site's Hosting Company asking for this specific facility to be made available. They may try to fob you off saying that the service is provided by a 3rd party and they can do nothing. Don't accept that - ask them to coordinate it with the 3rd party. In the end it may require you to move over to a different 3rd party db server, once again ask them to coordinate that ... Be polite, but firm and I'm sure that they will help you get the "Table Options" incorporated, then we can continue...


----------



## JiminSA (Dec 15, 2011)

Just a thought - if you ensure that your user in the mySQL databases control panel has been assigned all privileges, you may not need to bother your Hosting people, as it will probably give you the "Table Options"


----------

