tags:

views:

171

answers:

2

I've created a snippet that pulls data from a databse table and displays it in tabular format. The snippet takes an id as parameter, and this is added to the sql query.

My problem is that if I've got more than 1 snippet call (sometimes need the tabular data for different id's displayed on a page) on the same page, all table data is the same as the last database call that's been made by the last snippet.

What do I need to do to kinda not cache the snippet database calls and have them all display their own content?

I've tried setting the page to no cache-able. Also used the [! !] brackets for the snippet calls, and even used the function_exists() method, but none of them helped.

Please can someone help me?

thanks

A: 

Try this at the end of the snippet:

mysql_connect('host', 'user', 'pass');
mysql_select_db('db_name');

You need to specify the connection parameters ofcourse.

Maciej
A: 

It would help to answer if you can post your snippet. I do this with multiple calls on the page without issue, so there is either something wrong inside the snippet, or you need to output to unique placeholder names.

PeterB