Faks Posted October 7, 2010 Share Posted October 7, 2010 Hi all i hope to find cure to my problems here is code of comment link <a href='/blogs/?page=comment&id=".$row['id']."'>Comment</a> here is code of whole comment page http://paste.php.lv/4c30d2286cdd7334d856ce966abc618f?lang=php And here is Pictures what's is going on on website.... Here is my main issue there are 3 comment's and they all well make such mess .... and if there aren't any comment's have such issue .... Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/ Share on other sites More sharing options...
jammesz Posted October 7, 2010 Share Posted October 7, 2010 Not sure how this is really related to php except maybe wordwrap() function to wrap the comments to a certain width. This seems more like a design problem in regards to how your html layout for the comments are and the css. Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119849 Share on other sites More sharing options...
Faks Posted October 7, 2010 Author Share Posted October 7, 2010 right now it's clean php code there's no style for website cause main purpose is to make working code later to make theme for website ! sow i would like hear more rather related to topic answer or ideas or anything else what can help . Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119851 Share on other sites More sharing options...
jammesz Posted October 7, 2010 Share Posted October 7, 2010 Here is my main issue there are 3 comment's and they all well make such mess .... Can you please explain further what the problem is? Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119861 Share on other sites More sharing options...
Faks Posted October 7, 2010 Author Share Posted October 7, 2010 http://faksx.sytes.net/blogs check the website news then click the comment i don't know how to explain image there must be Title and news text but instead i got 3 comments with same information again and again . good example is http://www.phpfreaks.com/blog/announcing-php-freaks-live-chat Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119866 Share on other sites More sharing options...
jammesz Posted October 7, 2010 Share Posted October 7, 2010 Im guessing this is what your talking about: http://faksx.sytes.net/blogs/?page=comment&id=2 I get this error when trying to submit a comment: Incorrect integer value: '' for column 'news_id' at row 1 looking at: $insert = sprintf("INSERT INTO comment (comment_name,comment_datetime,comment_text,news_id,comment_ip) VALUES ('%s',now(),'%s','%s','$ip')",$name,$text,$nid); it looks like your inserting $text into the field news_id which only accepts int values. Where $text is my comment. Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119876 Share on other sites More sharing options...
Faks Posted October 7, 2010 Author Share Posted October 7, 2010 that's is my second issue if i put number instead %s it works but then it is bound by static number i am sure it can bet put by post somehow directly in database. Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119886 Share on other sites More sharing options...
jammesz Posted October 7, 2010 Share Posted October 7, 2010 Try this: $insert = "INSERT INTO comment (comment_name,comment_datetime,comment_text,news_id,comment_ip) VALUES ('".$name."',".now().",'".$text."','".$nid."','".$ip."')"; Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119895 Share on other sites More sharing options...
Faks Posted October 7, 2010 Author Share Posted October 7, 2010 Try this: $insert = "INSERT INTO comment (comment_name,comment_datetime,comment_text,news_id,comment_ip) VALUES ('".$name."',".now().",'".$text."','".$nid."','".$ip."')"; ain't working got error Fatal error: Call to undefined function now() in F:\My Documents\Websites Backup,Testing Tools,Projects\wnmp\nginx\htdocs\blogs\body_1_view.php on line 37 Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119896 Share on other sites More sharing options...
BlueSkyIS Posted October 7, 2010 Share Posted October 7, 2010 now() is a MySQL function. Leave it quoted, not un-quoted... ('".$name."', NOW() ,'".$text."'... etc. Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119938 Share on other sites More sharing options...
Faks Posted October 7, 2010 Author Share Posted October 7, 2010 now() is a MySQL function. Leave it quoted, not un-quoted... ('".$name."', NOW() ,'".$text."'... etc. just like i tout but now again i am stuck with news_id ( Incorrect integer value: '' for column 'news_id' at row 1) i know it cause it is INT and it will accept numbers only part how to figure it out form post id of news inside database i could guess $_POST['id'] directly in mysql ? Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1119979 Share on other sites More sharing options...
Faks Posted October 8, 2010 Author Share Posted October 8, 2010 BUMP sorry for bump but it's all ready almost a month and nobody can help me to resolve the problem .... Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1120407 Share on other sites More sharing options...
BlueSkyIS Posted October 8, 2010 Share Posted October 8, 2010 post your latest code and the complete error message Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1120421 Share on other sites More sharing options...
Faks Posted October 9, 2010 Author Share Posted October 9, 2010 Here's whole code of page .... 1.I need fix from top in those pictures those issues or bugs for comment section .... 2.Fix Comment Posting Issue inside INT Table news_id To see in action all problems visit http://faksx.sytes.net/blogs/ <?php #if(!$_SESSION['logged_in'] or $_SESSION['u_level'] >= 2 xor 5 xor !$_SESSION['u_level'] > 1) { #die ('<p><h2><center>Lūdzu Autorezejaties </center></h2>'); #}else #{ $id = isset ($_REQUEST['id']) ? abs(intval($_REQUEST['id'])) : false; $page = isset ($_GET['start']) ? trim($_GET['page']) : false; #$id = $_GET['id']; #$id = (isset ($_GET['id']) ? abs(intval ($_GET['id'])); @mysqlutf8(); #$news_select = ("SELECT news.id,news_title,news_text , comment .* FROM news, comment WHERE comment.news_id = '$id'; "); $news_select = ("SELECT `id`,`news_id` AS `c`,(SELECT `news_text` FROM `news` WHERE `id`=`c`) AS `news_teksts`,(SELECT `news_title` FROM `news` WHERE `id`=`c`) AS `news_title`,`comment_name`,`comment_text`,`comment_datetime` FROM comment WHERE `news_id`= '$id'; "); #$comment_select = ("SELECT comment_name,comment_datetime,comment_text FROM comment"); // 2 $new_result = mysql_query($news_select) or die(mysql_error()); #$comment_result = mysql_query($comment_select) or die(mysql_error()); // 2 while ($news = mysql_fetch_array($new_result)) #while ($comment = mysql_fetch_array($comment_result)) // 2 echo '<h2>'.$news[news_title].'</h2>'.'<br>'.$news[news_teksts].'<br><h2>Komentāri</h2><br>'."<strong><span style='font-size: 11px;color:green;'>".$news[comment_name].' '.$news[comment_datetime].'</span></strong>'.'</h3>'.'<br><br><strong>'.$news[comment_text].'</strong><p>'; if (isset($_POST['pievienot'])) { $name = mysql_real_escape_string($_POST[name]); $text = mysql_real_escape_string($_POST[text]); $nid = mysql_real_escape_string($_POST[nid]); $name = htmlentities($_POST[name]); $text = htmlentities($_POST[text]); $nid = htmlentities($_POST[$nid]); //news_id si ir problema kura moka iznak kad ieliek komentaru vins liek zem noteikta cipara pat nezinu ko izdomat . #$insert = sprintf("INSERT INTO comment (comment_name,comment_datetime,comment_text,news_id,comment_ip) VALUES ('%s',now(),'%s','2','$ip')",$name,$text,$nid); $insert = "INSERT INTO comment (comment_name,comment_datetime,comment_text,news_id,comment_ip) VALUES ('".$name."',NOW(),'".$text."','".$nid."','".$ip."')"; mysql_query($insert) or die(mysql_error()); } #} ?> <h3>Pievienot Komentāru</h3> <form method="post"> Vards : <br><input type="text" name="name" /><br> Komentara Teksts : <br><textarea name="text" cols="40" rows="6"></textarea><br> <input type="hidden" type="text" name="nid" value="<?php $id;?>"> <input type="submit" name="pievienot" value="pievienot" /> </form> Error message When Click Submit (Incorrect integer value: '' for column 'news_id' at row 1) Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1120502 Share on other sites More sharing options...
Faks Posted October 9, 2010 Author Share Posted October 9, 2010 Comment posting problem resolved but now left only to resolve the comment page issues . All These issues are related to all comment's not only shown in pictures . Here is example of my problem there are 3 comment authors and each of them have own title and news text but instead i need News Title And Text and under all this Author of comment,date good example were http://www.phpfreaks.com/blog/announcing-php-freaks-live-chat how it should look like . Here is example of comment page without comment's yet it shows a white blank but instead it should show news title and text if there is a comment it appears .... Link to comment https://forums.phpfreaks.com/topic/215349-problem-with-comment-page/#findComment-1120512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.