Mismatching table names
| Project: | osCommerce |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | MySQL, Rows, Tables |
Jump to:
I am just experiencing the oscommerce module with my Drupal and OSCommerce installation. First, for some reason, the admin interface didn't took my dbserver, name and password. So I just hardcoded them on oscommerce.module
function oscommerce_db() {
$host = variable_get('oscommerce_host', 'myserver');
$database = variable_get('oscommerce_database', 'mydatabase');
$user = variable_get('oscommerce_user', 'myuser');
$password = variable_get('oscommerce_password', 'mypassword');
With this, I was able to go a lot further. Now, when I try to admin Product Categories, I have the following warning:
warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/doceebagana/public_html/modules/oscommerce/oscommerce.module on line 364.
Around line 364 of oscommerce.module there is the following:
while ($row = mysql_fetch_array($ret)) {
$prods[] = array(
'id' => $row['products_id'],
'model' => $row['products_model'],
'name' => $row['products_name'],
'description' => $row['products_description'],
'image' => $images.$row['products_image'],
'compatibility_set' => $row['compatibility_set']
So, I checked against the database and I could see those rows come from several tables, but one, products extra, which simply doesn't exist in my OSCommerce install. Looks like the rows products_image and compatibility_set must be in this table.
Am I doing something wrong or is this actually a bug?
Thanks!
Cesar

#1
Forgot to tell you... My OSCommerce version is the latest: osCommerce Online Merchant v2.2 Release Candidate 2a
#2
I wish everyone gave such a good description of the issue!
products_extra is created by the module - this should happen when you go into the admin screen and click Save. It sounds like you have bypassed this.
However, now that you have a database connection you should be able to go into the admin screen and click save (there's a checkbox that says "Install tables...").
I hope this gets you a bit further.
#3
Thanks Steve! I had misunderstood the line:
>> Install or update extra tables needed for the osCommerce link (for future use)
I thought the - for future use - was just a placeholder for some functionality to be added. English as a second language... ;)
I went further, no more MySQL warnings. However, I am still fighting with my install. After I select all my Manufacturers and Categories from the admin panel and save it, the name of the Categories just vannish. If I restore the defaults and start over, they appear again, just to vannish after I save it again. When I access Product Categories, I get nothing at all (other than the title Product Categories). When I access Product Manufacurers I got the title and t.b.c. below it.
The only thing I have in the error log is several missing images, such as:
page not found 01/29/2009 - 11:12 oscommerce/catalog/imagescategory_dvd_movies.gif
I am still researching and any help is welcome!
Thanks again!
Cesar
#4
Regarding the Product Categories, it seemed to have been a browser cache issue... It works now. With Manufacturers I still experience the same thing.
#5
I'm having a similar issue with the mysql_fetch_array() warning. I have checked the "Install or update extra tables needed for the osCommerce link (for future use)" box several time but I still get this error
warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [my directory]/modules/oscommerce/oscommerce.module on line 364.
It is connecting with the OSC database and showing categories and their images. When I click on a catagory nothing appears on the page other than the error.