PHP line break

Okay I did that,

got this message

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in D:\Hosting\8263933\html\bdwebsite\index.php on line 65

Missing ; maybe?

Sam

In which case all these issues have been caused by my SQL statement… $query is set to boolean false as the query has failed. Try changing “COUNT(c.*) AS n” to “COUNT(c.parent) AS n”

Okay!

Were getting some where! I now get

<
Page: 1

Page: 1 of 1

But none of the stories are displayed as before. You can see what I mean on the site www.banterdonkey.com

Many Thanks,

Sam

Haha! That’s because I shouldn’t code when it’s late… so many errors. I do apologise for messing up almost every aspect of my code…

[php]$posts[$i] = “

”;
$posts[$i] = “
”.$row[‘P_Id’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] = “
”.$row[‘story’]."
"; // Replace “column_two” with the name of your second column.
$posts[$i] = “
<a user.php?userid=”.$row[‘screen_name’]."’>".$row[‘screen_name’].“donkey
”;
$posts[$i] = “
”.$row[‘date’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] = “
”.$row[‘time’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] = “
”.$row[‘n’]."
"; // Replace “column_three” with the name of your third column.
$posts[$i] = “
<a href='readmore.php?storyid=”.$row[‘P_Id’]."’>Read more
"; // Your submit button. (adds one to each row)
$posts[$i] = “”;
$posts[$i] = “

”;[/php]

should be:
[php]$posts[$i] = “

”;
$posts[$i] .= “
”.$row[‘P_Id’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] .= “
”.$row[‘story’]."
"; // Replace “column_two” with the name of your second column.
$posts[$i] .= “
<a user.php?userid=”.$row[‘screen_name’]."’>".$row[‘screen_name’].“donkey
”;
$posts[$i] .= “
”.$row[‘date’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] .= “
”.$row[‘time’]."
"; // Replace “column_one” with the name of your first column.
$posts[$i] .= “
”.$row[‘n’]."
"; // Replace “column_three” with the name of your third column.
$posts[$i] .= “
<a href='readmore.php?storyid=”.$row[‘P_Id’]."’>Read more
"; // Your submit button. (adds one to each row)
$posts[$i] .= “”;
$posts[$i] .= “

”;[/php]

Okay,

This loads storyid 5 only, also the comment count function doesn’t work anymore it just prints the story ID again rather than counting the number of comments. I will have a look in the morning when I’m not so tired.

Thank you very much for your help. I’ll let you know if i crack it!

Sam

Okay, if you can’t solve it let me know your table structures and ill add some test data (or you can send me a whole sql dump and ill load all of your data if you’re happy to). Then I can test away locally and work out a resolve quicker than posting the code to you and then asking if it works!

I have an sql dump of the database. How shall I send these to you?

Many thanks for your help

Sam

You can private message me and put the SQL in a code block, or upload the file to your website with a strange name that cant be guessed and PM me the url.

Sponsor our Newsletter | Privacy Policy | Terms of Service