Hi,
Installed OC. Looks great.
Can I add a table to the database, and if so, how do I refer to it in the page coding, since the existing version of my client's page uses a database and connection function that I created earlier.
Obviously I need to scrub that - so do I just replace 'my' php-include file name with the OC php-include file name (whatever it is)?
Basically, what are the steps I need to take to make his site use only the OC database rather than the one I am currently using? A feature of the home page is that it displays the latest updates (for instance "Diversion due to large hole in Ketts Hill") which are retrieved from a database. I have provided my client with a quick form where he can enter these details but obviously if this form is now connecting to the OC database I need to know how to amend the connection details.
Many thanks!
Yes, you can add your own table to the database. Just don't touch any of the existing table's else you will cause problems.
To keep things simple, you can just make the call straight from the tpl file with the following code.
To keep things simple, you can just make the call straight from the tpl file with the following code.
Code: Select all
<?php $results = $this->db->query("SELECT name FROM new_table");
foreach($results->rows as $result) {
echo $result['name'];
} ?>
Ah, OK. So tpl is a template file. MVC? More mysterious acronyms! Googled, and take it that's Model-View-Controller. That's certainly useful for the next pub quiz, but I'm in the dark as to what it actually is! Probably a trip to the local library to request "the book" is on the cards.
Its just a framework that seperates the different erm... functions
Model - All the database calls
View - HTML & theming files
Controller - Place where the Model and View are Linked together
Each is seperated out for an easier logic
Look here for more information
http://forum.opencart.com/viewtopic.php?f=20&t=4113
Model - All the database calls
View - HTML & theming files
Controller - Place where the Model and View are Linked together
Each is seperated out for an easier logic
Look here for more information
http://forum.opencart.com/viewtopic.php?f=20&t=4113
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 219 guests