Jump to content

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.