Log in

View Full Version : V.IMP: PHP Include


Lord Brar
11-11-2004, 06:20 AM
I tried to use this



ob_start();

require_once("/home/pulsetod/public_html/featured-thread.php");

$featuredthread = ob_get_contents();

ob_end_clean();



in phpinclude_start



and when I use



$featuredthread in forum home template and try to access the site... i get this error -



Database error in vBulletin 3.0.3:

Invalid SQL:

SELECT

user.username, (user.options & 512) AS invisible, user.usergroupid,

session.userid, session.inforum, session.lastactivity,

IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid

FROM session AS session

LEFT JOIN user AS user ON(user.userid = session.userid)

WHERE session.lastactivity > 1100157315

ORDER BY username ASC



mysql error: Table 'pulsetod_featured.session' doesn't exist

mysql error number: 1146

Date: Wednesday 10th of November 2004 11:30:15 PM

Script: http://www.pulsetoday.com/index.php?

Referer: http://www.pulsetoday.com/admincp/index.php?do=head

Username: pulsetoday

IP Address: 61.246.188.34



Can anyone help me please. it's very imp. for me to include this file in the site..



Here's the code for featured-thread.php



<?php

require('./featured/wp-blog-header.php');

?>

<?php $posts = get_posts('numberposts=1'); foreach ($posts as $post) : start_wp(); ?>

<?php the_content(); ?>

<?php endforeach; ?>

Andreas
11-11-2004, 07:27 AM
I guess your script changes the database, and thus vB can't find its tables anymore.

Either put all tables in one database, or make sure vB and your script use different connections so they wont interfere with each other.

Lord Brar
11-11-2004, 08:51 AM
hmm.. Yeah. they are using diggerent databases [wordpress and vb :P ]...

Gotta find some alternative ;) But thanks a lot for your reply!

Reeve of shinra
11-11-2004, 11:36 AM
Plug that into a php file with the appropriate links to the WP DB. Then change your php_start script to access the new file you created.