PDA

View Full Version : Help Requested! Anybody have any idea what's the go?



Foxcom
04-01-2013, 07:51 AM
Hello Guys,

I'm very stuck.

I'm doing a simple forum script and i have integrated CKEditor and everything seems to be find although when i submit my post the result turns out in code?
(It's not formatting the HTML code it's actually displaying it)

I've been messing around for some hours now and i am very stuck, I'll post an example:

(Quick Reply - CKEditor) Content:

Hello

Test
One
Two Three!

(View Reply) Content:

<p> Hello<br /> <br /> Test<br /> One<br /> Two Three!</p>

I'm in desperate need and don't have much time on my hands. If anybody could please help me out.


This is the code to display the result:
' . htmlentities(($posts_row['post_content'])) . '

This is the textarea code:
<textarea class="textarea" id="editor1" name="reply-content" rows="7" cols="51"></textarea><script type="text/javascript">
CKEDITOR.replace( "editor1" );
</script>

This is the main code to get the results:
$sql = "SELECT
topic_id,
topic_subject
FROM
topics
WHERE
topics.topic_id = " . mysql_real_escape_string($_GET['id']);

$result = mysql_query($sql);

if(!$result)
{
echo 'The topic could not be displayed, please try again later.';
}
else
{
if(mysql_num_rows($result) == 0)
{
echo 'This topic doesn&prime;t exist.';
}
else
{
while($row = mysql_fetch_assoc($result))
{
//display post data
echo '<table class="topic" border="1" width="719" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">';

//fetch the posts from the database
$posts_sql = "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
posts.post_topic = " . mysql_real_escape_string($_GET['id']);

$posts_result = mysql_query($posts_sql);

if(!$posts_result)
{
echo '<tr><td>The posts could not be displayed, please try again later.</tr></td></table>';
}
else
{

while($posts_row = mysql_fetch_assoc($posts_result))
{

-Nick
04-01-2013, 11:07 AM
I don't quit get what you mean,... Are you trying to make a table or ?

Zak
06-01-2013, 11:43 AM
I don't quit get what you mean,... Are you trying to make a table or ?

He is attempting to retrieve data I'm guessing as the SQL always starts with SELECT.

Though I'm as stumped as you as to what he's trying to do.

Do you even have all the tables and field names required to run that query?

Because that just looks copy and pasted from some site to me lol

Foxcom
08-01-2013, 10:54 AM
Thank-You for your reply.
I have had this sorted out already.
Thanks (:

Want to hide these adverts? Register an account for free!