Stotty Posted November 16, 2008 Share Posted November 16, 2008 Well ive made some custom forums, http://fateorfantasy.exofire.net/board/message.php?id=1 Direct Link It should say in your header broser title PHP Freaks Help - Cetoxis Forums seen as thats the thread name But it is Printing Resource id #3 If You could help i would love that here is my full code for message.php "need more info [email protected]" is my msn <?php include "connect.php"; //mysql db connection here $title = "SELECT title FROM forumtutorial_posts"; $title=mysql_query($title) ?> <html> <head> <title><?php echo $title; ?> - Cetoxis Boards</title> </head> <body> <?php $id=$_GET['id']; print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='index.php'>Back to main forum</a>-<A href='post.php'>New Topic</a>-<A href='reply.php?id=$id'>Reply<br>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=20%>Author</td><td width=80%>Post</td></tr>"; $gettopic="SELECT * from forumtutorial_posts where postid='$id'"; $gettopic2=mysql_query($gettopic) or die("Could not get topic"); $gettopic3=mysql_fetch_array($gettopic2); print "<tr class='mainrow'><td valign='top'>$gettopic3[author]</td><td vakign='top'>Last replied to at $gettopic3[showtime]<br><hr>"; $message=strip_tags($gettopic3['post']); $message=nl2br($message); print "$message<hr><br>"; print "</td></tr>"; $getreplies="Select * from forumtutorial_posts where parentid='$id' order by postid desc"; //getting replies $getreplies2=mysql_query($getreplies) or die("Could not get replies"); while($getreplies3=mysql_fetch_array($getreplies2)) { print "<tr class='mainrow'><td valign='top'>$getreplies3[author]</td><td vakign='top'>Last replied to at $getreplies3[showtime]<br><hr>"; $message=strip_tags($getreplies3['post']); $message=nl2br($message); print "$message<hr><br>"; print "</td></tr>"; } print "</table>"; ?> </p> <p align="right">Powered By Cole</p> </body> </html> Thanks in Advanced Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/ Share on other sites More sharing options...
bobbinsbro Posted November 16, 2008 Share Posted November 16, 2008 in your code, $title is a result object, not a string. you need to get the contents of the query by fetching the result into a variable. Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691202 Share on other sites More sharing options...
Stotty Posted November 16, 2008 Author Share Posted November 16, 2008 Yup, i just dont understand how can any of you people help me do it like show me how its done Very Greatfull Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691203 Share on other sites More sharing options...
bobbinsbro Posted November 16, 2008 Share Posted November 16, 2008 <?php include "connect.php"; //mysql db connection here $sql = "SELECT title FROM forumtutorial_posts"; $result = mysql_query($sql) or die(mysql_error()); $title = mysql_fetch_row($result); echo '<title>'.$title[0].' - Cetoxis Boards</title>'; ?> this assumes that the desired title is the first row in forumtutorial_posts. Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691204 Share on other sites More sharing options...
Stotty Posted November 16, 2008 Author Share Posted November 16, 2008 Thanks, going to test right this second Edit : Its not Displaying the Title PHP Freaks Help For Every Topic :s Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691206 Share on other sites More sharing options...
Stotty Posted November 16, 2008 Author Share Posted November 16, 2008 My Database Setup CREATE TABLE forumtutorial_posts ( postid bigint(20) NOT NULL auto_increment, author varchar(255) NOT NULL default '', title varchar(255) NOT NULL default '', post mediumtext NOT NULL, showtime varchar(255) NOT NULL default '', realtime bigint(20) NOT NULL default '0', lastposter varchar(255) NOT NULL default '', numreplies bigint(20) NOT NULL default '0', parentid bigint(20) NOT NULL default '0', lastrepliedto bigint(20) NOT NULL default '0', PRIMARY KEY (postid) ) Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691207 Share on other sites More sharing options...
bobbinsbro Posted November 16, 2008 Share Posted November 16, 2008 <?php include "connect.php"; //mysql db connection here $sql = "SELECT title FROM forumtutorial_posts WHERE postid=".$_GET['id']; $result = mysql_query($sql) or die(mysql_error()); $title = mysql_fetch_row($result); echo '<title>'.$title[0].' - Cetoxis Boards</title>'; ?> Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691208 Share on other sites More sharing options...
Stotty Posted November 16, 2008 Author Share Posted November 16, 2008 Thanks Bobbinsbro, All Working thanks i cannot tell you how happy i am now was trying for 5 hours yesterday to get that working Link to comment https://forums.phpfreaks.com/topic/132924-solved-grabing-from-row-custom-forums/#findComment-691211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.