Community Forums

Query another database from .tpl page

General support for technical problems with OpenCart v0.x

Query another database from .tpl page

Postby redboxdesign » Fri Apr 11, 2008 6:08 am

Just installed opencart and loving it. I'm starting to customise sections of the page layout and modify the code... I now have an error at the bottom of catalog pages:

Error: Table 'minimonk_admin.session' doesn't exist
Error No: 1146
select * from session where session_id = '045427b19199d8548d1937fb470f7cf5'

What I've done is replace the entire 'information.tpl' document with a random testimonial from another mysql database (I liked where it was positioned as a 'testimonial block'. Is this a bad thing to do? Should I move the testimonials table into the opencart database or is there another fix out there?

Thanks to all the developers and contributors out there!!
redboxdesign
 
Posts: 7
Joined: Fri Apr 11, 2008 5:57 am

Re: Query another database from .tpl page

Postby bruce » Fri Apr 11, 2008 6:18 am

Information is a module that can be enabled or disabled if you want. Have a look in store admin menu Extensions->Module to see them all.

What you could do is to create your own testimonial module based on the module that is closest in functionality to what you want and modify layout.tpl to display it if it is enabled.
bruce
 
Posts: 1094
Joined: Wed Dec 12, 2007 6:26 am

Re: Query another database from .tpl page

Postby redboxdesign » Fri Apr 25, 2008 12:13 pm

Thanks bruce! I played around with enabling/disabling modules but ended up creating a table within the opencart database and a small php script to call the data inside the layout.tpl file. Easier than creating a new module which seems very hard to do as a newbie!
redboxdesign
 
Posts: 7
Joined: Fri Apr 11, 2008 5:57 am

Re: Query another database from .tpl page

Postby zapper » Mon Dec 22, 2008 12:20 am

I am also having this problem, so it seems when a custom php mysql query is added in the layout file this error message occurs.

Did you manage to get this of this error message?
zapper
 
Posts: 13
Joined: Sun Oct 12, 2008 10:47 pm

Re: Query another database from .tpl page

Postby zapper » Mon Dec 22, 2008 12:43 am

I created the tables within the opencart cart database, now it is fine and does not up with the error.
zapper
 
Posts: 13
Joined: Sun Oct 12, 2008 10:47 pm


Return to General Support

Who is online

Users browsing this forum: No registered users and 2 guests

Hosted by Arvixe Web Hosting