kickoff3pm Posted January 4, 2008 Share Posted January 4, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/ Share on other sites More sharing options...
revraz Posted January 4, 2008 Share Posted January 4, 2008 The URL is used in a GET statement in PHP, you can always use PHP to change them around. Quote Link to comment https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/#findComment-430632 Share on other sites More sharing options...
kickoff3pm Posted January 4, 2008 Author Share Posted January 4, 2008 The URL is used in a GET statement in PHP, you can always use PHP to change them around. I don't want to change the statment as such. Quote Link to comment https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/#findComment-430801 Share on other sites More sharing options...
revraz Posted January 4, 2008 Share Posted January 4, 2008 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' Quote Link to comment https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/#findComment-430811 Share on other sites More sharing options...
kickoff3pm Posted January 5, 2008 Author Share Posted January 5, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/84524-database-fields-ref-with-another-name/#findComment-431432 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.