yami007 Posted October 6, 2008 Share Posted October 6, 2008 well, this is my page where i want to display different comments for each isngle page, it needs a lot so i'm counting on you.. <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php function get_comments_for_singer($singer_id) { global $connection; $query = "SELECT * FROM comment "; $comment_set = mysql_query($query, $connection); confirm_query($comment_set); return $comment_set; } ?> <?php find_selected_page(); ?> <?php if (isset($_GET['comment'])) { $comments = get_comments_for_singer($sel_comment['id']); while ($comment = mysql_fetch_array($comments)) { ?> <html> <head> <title><?php echo "My comments"; ?></title> <link rel="stylesheet" href="stylesheets/style.css" type="text/css" /> </head> <body> <strong><?php echo $comment['pseudo']; ?></strong> a écrit:<br /> <?php echo $comment['message']; ?> </body> </html> <?php } } else { echo "the page isnt available"; } ?> <?php mysql_close(); ?> and here's my comment table CREATE TABLE `comment` ( `id` int(11) NOT NULL auto_increment, `singer_id` int(11) NOT NULL, `pseudo` varchar(30) NOT NULL, `message` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; I tried to use "WHERE singer_id =" . $singer_id . " "; but it didnt work need your help ! Link to comment https://forums.phpfreaks.com/topic/127230-solved-what-do-i-have-to-do-to-display-comments-on-a-different-pages/ Share on other sites More sharing options...
revraz Posted October 6, 2008 Share Posted October 6, 2008 echo $query and see what it populates with. use mysql_error after your query to see if there are any errors. Link to comment https://forums.phpfreaks.com/topic/127230-solved-what-do-i-have-to-do-to-display-comments-on-a-different-pages/#findComment-658064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.