Code: Alles auswählen
SQL ERROR [ mysqli ]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}' at line 3 [1064]
SQL
SELECT star, feed FROM de_twc_topics WHERE topic_id = {BW_topic}
BACKTRACE
FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()
FILE: star.php
LINE: 42
CALL: dbal_mysqli->sql_query()
Code: Alles auswählen
<?php
/**
*
* @package TWCbb3
* @version $Id: star.php 9470 2011-01-25 17:22:41Z Thomas $
* @copyright (c) 2005 TWCmail
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'bw_mod/includes/config.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
$topic = $_GET['t'];
if (isset($_GET['star'])) {
$sql = 'SELECT star, feed
FROM de_twc_topics
WHERE topic_id = '.$_GET['t'].'';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$calcstar = $_GET['star'];
$feedcalc = $row['feed'];
$starcalc = $row['star'];
$calcfeed = 1;
$star = $starcalc+$calcstar;
$feed = $calcfeed+$feedcalc;
$db->sql_transaction('begin');
$sql = "UPDATE twc_de_topics
SET star = ".$star."
WHERE topic_id = ".$_GET['t']."";
$db->sql_query($sql);
$sql = "UPDATE de_twc_topics
SET feed = ".$feed."
WHERE topic_id = ".$_GET['t']."";
$db->sql_query($sql);
$db->sql_transaction('commit');
}
// Output page
page_header($user->lang['INDEX']);
$template->assign_vars(array(
'BW_save' => sprintf("Bewertung gespeichert"))
);
// Output page
page_header($user->lang['INDEX']);
$template->set_filenames(array(
'body' => 'twc_bw_repup.html',
));
page_footer();
}
else {
$template->assign_vars(array(
'BW_topic' => sprintf($_GET['t']))
);
$template->set_filenames(array(
'body' => 'twc_bw_popup.html',
));
page_footer();
}
?>