Categories > TinyButStrong general >

an error Im getting

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Mankiy
Date: 2003-07-11
Time: 03:16

an error Im getting

Im getting this error:
TinyButStrong Error (MergeBlock): MySql: 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 '%p1%)' at line 1


i basically copied the code from the index example you gave me, and put it into the show_posts pg, and i dont get what its doing.......

heres the template code:
<html>
<head>
<title> {TITLE} </title>
</head>
<body bgcolor="#FFFFFF">

<TABLE border="0" cellspacing="0" cellpadding="0" width="700" align="center">
<TR><TD bgcolor="#898989" width="150">
<center><font size="3"> USER INFO </font></center>
</TD>
<TD width="550" bgcolor="#898989">
<center><font size="3"> POST INFO </font></center>
</TD></TR>


<TR>
<TD width="700" bgcolor="#C9C9C9">
<font size="1">Topic: {posts.topic;block=tr;extend=1;}</font>
</TD>

<TD width="150" bgcolor="#C9C9C9">
<b>{user_info.username;block=tr;p1={posts.posted_by}}</b>
<br>
<br>
<br>
Location: {user_info.location}
<br>
Posts: {user_info.posts}
<br>
Joined: {user_info.joined}
</TD>

<TD width="550" bgcolor="#C9C9C9">
{posts.post_text}
</TD>

<TD width="700" bgcolor="#C9C9C9">
<font size="1">Posted On:{posts.posted_on}</font>
</TD>
</TR>
</TABLE>

</body>
</html>

and heres the PHP code:
<?php
   require("config.php");
   require_once($clsdir."tpl_class.php");


$PAGE = new tpl_class;
$PAGE->LoadTemplate($tpldir."show_posts.tpl");


// session start and check
session_start();
$username = $_SESSION["username"];
$password = $_SESSION["password"];


$PAGE->MergeField("TITLE", "Hyperbb_Post List");
$PAGE->MergeBlock("posts", "mysql", "SELECT * FROM hyperbb_posts WHERE topic_ID='$_GET[t]'");
$PAGE->MergeBlock("user_info", "mysql", "SELECT username,posts,location,joined FROM hyperbb_members WHERE (username=%p1%)");

exit();
mysql_close();
?>


i cant really see whats wrong with it, any help plz?
By: Mankiy
Date: 2003-07-11
Time: 03:22

Re: an error Im getting

doh! >_<

forget this post, i figured it out, forgot the show()

im so stupid! >_<