Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is mySql Case Sensitive?


shana.jk

Recommended Posts

Posted

all my .php doc request tables in ALL CAPS... and all my mySql tables are in lower case.

 

What can i do its causing it not to be able to locate the tables becuase its looking for lower case. I can change all of them.... :'( but that would suck. Is there anyway to make it not case sensitive?

 

example of one error

1146 - Table 'bpbponl_store.PRODUCTS_DESCRIPTION' doesn't exist

 

If i change PRODUCTS_DESCRIPTION to all lower case in the .php file it works.

Posted
all my .php doc request tables in ALL CAPS... and all my mySql tables are in lower case.

 

What can i do its causing it not to be able to locate the tables becuase its looking for lower case. I can change all of them.... :'( but that would suck. Is there anyway to make it not case sensitive?

 

example of one error

1146 - Table 'bpbponl_store.PRODUCTS_DESCRIPTION' doesn't exist

 

If i change PRODUCTS_DESCRIPTION to all lower case in the .php file it works.

 

You may be messing with things you don't quite understand so be careful.

 

In oscommerce database names are defined in ..

 

catalog/includes/database_names.php .. e.g.

 

define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');

 

The constant TABLE_PRODUCTS_DESCRIPTION has a value of products_description

 

So, if you take a typical query from product_info.php it looks like ..

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

By changing TABLE_PRODUCTS_DESCRIPTION to products_description you are using its real name as opposed to its defined name which is bad coding practice and will get you into all sorts of problems later.

 

Hope that helps

Posted
You may be messing with things you don't quite understand so be careful.

 

In oscommerce database names are defined in ..

 

catalog/includes/database_names.php .. e.g.

 

define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');

 

The constant TABLE_PRODUCTS_DESCRIPTION has a value of products_description

 

So, if you take a typical query from product_info.php it looks like ..

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

By changing TABLE_PRODUCTS_DESCRIPTION to products_description you are using its real name as opposed to its defined name which is bad coding practice and will get you into all sorts of problems later.

 

Hope that helps

 

 

 

Well thats fine i would rather not change it.... So how do i fix the error? I dont want to have to go in and change every file anyway. I get the error on everything.

Posted
So how do i fix the error?

 

how about you post the code that you are trying to get to work? that way we can help you through the changes needed to get it to work properly. if you're trying to do "select * from TABLE_PRODUCTS_DESCRIPTION" it won't work, but "select * from " . TABLE_PRODUCTS_DESCRIPTION will because now you're using the defined value of TABLE_PRODUCTS_DESCRIPTION, which is "products_description".

 

but to answer your original question, mysql is *not* case sensitive.

Archived

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

×
×
  • Create New...