Jump to content

Database fields ref with another name ?


kickoff3pm

Recommended Posts

Hi everyone, thanks for looking.

 

I use oscommerce shopping cart but to make it fit in with my type of site I have changed some database table field names. For example the is one named "MANUFACTURES" I've changed that to "SEASONS". Because I've matched these changes in the PHP code the cart still works fine.

 

Here's the problem - Because I've changed the the field names my desktop manament software can't pull in these those field renamed. It's not a big problem but makes updates a bit long winded. So what I want to do is revert back to the correct field names but still have the site look how it is now ie. like this;

 

http://www.mysite/shop/index.php?seasons_id=14

 

NOT

 

http://www.mysite/shop/index.php?manufacturers_id=14

 

So the question is - is the a way to query the database field with one name MANUFACTURES but output SEASONS in the url ?

 

Not sure really if this is a PHP question now, anyway any ideas welcome.

Link to comment
https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/
Share on other sites

This is your question

So the question is - is the a way to query the database field with one name MANUFACTURES but output SEASONS in the url ?

 

The answer is yes.

 

 

$fieldname = $_GET['seasons_id'];

 

Query blah bah WHERE manufactures = '$fieldname'

This is your question

So the question is - is the a way to query the database field with one name MANUFACTURES but output SEASONS in the url ?

 

The answer is yes.

 

 

$fieldname = $_GET['seasons_id'];

 

Query blah bah WHERE manufactures = '$fieldname'

 

Sorry I don't really understand that can you explain a bit more, are you not just adjust the query to select data that is = to seasons_id ?

 

TIA

 

 

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.