Custom theme "table doesn't exist" error

volfro Member
Hi!

I developed a custom theme for ZP using the instructions for a ZP/WP integrated theme found at ruzee.com. (I actually hard-coded the header in instead of calling it so that I could customize the navigation.)

The theme works just fine locally, and looks great. (PHP version 5.2.1, MySQL version 5.0.38-Ubuntu_0ubuntu1-log.) ZP installs just fine on my shared hosting server, and actually runs perfectly when I'm using any one of the included themes. But when I try to use my custom theme, ZP dies as soon as it hits the loop (`<?php while (next_album()):?>` on index.php) with the following error message:

`MySQL Query ( SELECT folder, sort_order FROM 'albums' ORDER BY sort_order ) Failed. Error: Table 'bsd_wordpress.albums' doesn't exist`

The shared hosting service is using PHP 5 (not sure of the full version) and MySQL 4.1.14

Any ideas about what I'm doing wrong? I'm kinda stumped, since it works just fine locally. `cache` and `albums` are at 0777 on the server, and as far as I know, .htaccess and zp-config.php are configured correctly. And like I said, the included themes work fine.

I should also tell you that according to phpMyAdmin, the tables are there.

Comments

  • 1) do you have a link we can look at?
    2) copy your zp-config.php database portion into here so we can look at it (obvioulsy minus the username and pass).
  • volfro Member
    Here it is. It's going to be an online portfolio/blog thing.

    Zp-config looks a little something like this:

    `

    ////////////////////////////////////////////////////////////////////////////////

    // Database Information (the most important part!)

    ////////////////////////////////////////////////////////////////////////////////

    $conf['mysql_user'] = "my user info";

    $conf['mysql_pass'] = "my password";

    $conf['mysql_host'] = "mysql01.powweb.com"; // Won't need to change this 90% of the time.

    $conf['mysql_database'] = "zenphoto_bsd";

    // If you're sharing the database with other tables, use a prefix to be safe.

    $conf['mysql_prefix'] = "";

    `

    No prefix, and it's connecting to/writing to the database just fine. I think.

    Thanks!
  • volfro Member
    Should I post the contents of my index.php as well?
  • volfro Member
    Hope this helps somebody help me...The index.php looks like this, up until the loop:

    `<?php if (!defined('WEBPATH')) die(); ?>

    <?php require($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php'); ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    >



    ; charset=<?php bloginfo('charset'); ?>" />

    <?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?>

    ...blah blah blah meta tags



    " type="text/css" media="screen" />

    RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

    " />

    <?php zenJavascript(); ?>

















    Here are some examples of my past work.

      <?php while (next_album()):?>
      • `

        You can see some of the WP conditionals there in the navigation; I also need to be able to use WP template tags/conditional statements for the sidebar and footer. The problem has to be somewhere in there, right? Since when the page is put together, it gets as far as "Here are some examples of my past work." Again, the theme works locally, and every other default theme works on the shared server.

        Hope that's enough info! Thanks again for any and all help.
  • This setup doesnt seem to follow the setup on ruzee.com

    The reason it is not working is because it is looking at the incorrect database. it is looking at your wordpress database for the zenphoto pictures (bsd_wordpress.albums as opposed to zenphoto_bsd.albums as specified in your zp-config)

    There is nothing in your index that specified to connect to the zenphoto database. You said you hardcoded the header for your navigation but after the wp header you need the db_connect() to connect to the zenphoto database then after the zp loops you need to add back in the $wpdb->select(DB_NAME); // reconnect wordpress db.

    I hope this maybe sheds a little light on your problem
  • volfro Member
    Craps. You're exactly right. I had been using the same DB as the WP one on my local server instead of creating a new one for ZP.

    Told it to hook up to the ZP database and it works like a charm now. Thanks chili! I needed some outside eyes to catch such a dumb mistake.
Sign In or Register to comment.