post upgrade: public_html/wordpress/wp-content/plugins/pods/core/Pod.class.php on line 56

0

hi, I have upgraded my pods install and got this on my page

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/pascaleb/public_html/wordpress/wp-content/plugins/pods/core/Pod.class.php on line 56

I seen this error on a lot of site, since the last update. but I have not found any resolution to it. 

so this is my template wp tempalte:  <?php /* Mystique/digitalnature */ /* Template Name: POD Porfolio */ get_header();?>   <div id="main">    <div id="main-inside" class="clear-block">
    <div id="primary-content">
     <div class="blocks">
     <div class="hentry page post-1 odd author-admin clear-block">  <h1 class="title">Portfolio</h1>          <? $Record = new Pod('portfolio'); 
                echo $Record->showTemplate('portfolio_mystic'); ?> </div></div></div> <?php get_sidebar(); ?> </div></div> <?php get_footer(); ?>

pod template is :  <span style="font-family: Arial,Arial; font-size: large;"><strong>{@name}</strong></span> <p><span style="font-family: Arial,Arial; font-size: medium;">{@body}</span><br/> <span style="font-family: Arial,Arial; font-size: small;"><a href="{@url}">Download</A></span></p> <hr><br>

if any one can shed some light on this. I guess me and a great many people will be happy.

asked Jun 9 '10 at 11:54

nissaba

1

add comment
enter at least 15 characters

2 Answers

1

The reason for the mysql error is that the method 'showTemplate' needs a database query before it can run. On a pod detail page, this is done automatically when you instantiate a new Pod, so this would work:

$slug = pods_url_variable();
$Record = new Pod('portfolio',$slug);
echo $Record->showTemplate('portfolio_mystic');

However, on a normal pod listing page, you need to call 'findRecords' first, which actually queries the database and sets up the template loop:

$Record = new Pod('portfolio');
$Record->findRecords('id DESC', 15);
echo $Record->showTemplate('portfolio_mystic');

See: http://podscms.org/codex/findrecords for more information about 'findRecords'.

answered Jun 10 '10 at 12:56

clarinetlord

456

edited Jun 11 '10 at 4:17

add comment
enter at least 15 characters
0

thanks it works! :)

answered Jun 10 '10 at 1:14

nissaba

1

add comment
enter at least 15 characters