Jump to content

shan2batman

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by shan2batman

  1. i understand pm your email ill send the sql file it is not live so it aint harmful.@barand
  2. i added another table here just posted to let you know the changes.Plus isn't there any way for me to get those unique values???? @Barand
  3. here is an update on the results: gp_id pid gname author_gp type title data pdate vote_up vote_down user_id_g group_id comment_id comment_body time_c os_id author_c type_c vote_up_c vote_down_c user_id_c gm_id gname mname approved admin g_id name creation logo invrule creator description update_id update_body url time host vote_up vote_down title user_id_u account_name author type data uname avatar user_id 1 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 297 Hi, @aboutthecreator i welcome you to myexpresspad 2016-09-25 16:53:01 0 0 lets test this message 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 297 Hi, @aboutthecreator i welcome you to myexpresspad 2016-09-25 16:53:01 0 0 lets test this message 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 297 Hi, @aboutthecreator i welcome you to myexpresspad 2016-09-25 16:53:01 0 0 lets test this message 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 299 what to expect from <a class="twitter-hashtag pret... 2016-11-04 03:54:27 0 0 my first post 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 299 what to expect from <a class="twitter-hashtag pret... 2016-11-04 03:54:27 0 0 my first post 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 19 17 MEP news shan2batman 1 this is a second comment 2018-09-24 12:32:39 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 299 what to expect from <a class="twitter-hashtag pret... 2016-11-04 03:54:27 0 0 my first post 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 16 0 MEP news shan2batman 0 how do i overcome the problems lets see how it works after i delete group posts 2018-09-24 11:55:44 0 0 0 25 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 304 i'm on cloud nine 2016-12-07 10:22:14 0 0 oooh yeah 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 18 16 MEP news shan2batman 1 this is a comment 2018-09-24 12:31:48 0 0 0 0 2 this is a profile comment 2018-09-24 12:36:21 302 shan2batman b 0 0 127 1 MEP news aboutthecreator 1 1 NULL NULL NULL NULL NULL NULL NULL 304 i'm on cloud nine 2016-12-07 10:22:14 0 0 oooh yeah 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 here is the query: select distinct g.* ,cu.*,gm.*,gp.*,up.*, u.uname,u.avatar,u.user_id from group_posts as g left join user as u on u.uname=g.author_gp left join updates as up on up.author=u.uname left join groups as gp on g.group_id=gp.g_id left join gmembers as gm on gm.gname=g.gname inner join comment_update as cu on cu.author_c=up.author where g.gname='MEP news' and u.uname='shan2batman' GROUP by g.data,up.update_body having u.uname='shan2batman'and g.gname='MEP news' order by u.user_id desc
  4. yes it is, but how do i correct the group_id values because it is the reason why i posted it in our forum @Barand
  5. finally i managed to fetch data from tables but the problem now is even after using distinct, groupby and having clauses the result is producing duplicate results its killing my brain @requinix can you point me where it is going wrong this is the updated query: select distinct g.* ,gp.*,up.*, u.uname,u.avatar,u.user_id from group_posts as g left join user as u on u.uname=g.author_gp left join updates as up on up.author=u.uname left join groups as gp on g.group_id=gp.g_id where g.gname='MEP news' and u.uname='shan2batman' GROUP by g.data,up.update_body having u.uname='shan2batman'and g.gname='MEP news' order by u.user_id desc here is the output: pid gname gp_id author_gp type title data pdate vote_up vote_down user_id_g group_id g_id name creation logo invrule creator description update_id update_body url time host vote_up vote_down title user_id_u account_name author type data uname avatar user_id 1 0 MEP news 11 shan2batman 0 ok lets see my first message #qwert 2016-08-12 20:17:21 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 12 shan2batman 0 my second message welcome to chennai 2018-09-23 18:39:30 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 13 shan2batman 0 see what can i do to create a perfect social network 2018-09-23 18:54:54 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 14 shan2batman 0 lets see hi this is a test msg 2018-09-24 09:27:14 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 15 shan2batman 0 group post this is a test for group post 2018-09-24 09:28:46 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 288 what kind of a life am i living?? 2016-06-15 22:01:09 0 0 hai 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 11 shan2batman 0 ok lets see my first message #qwert 2016-08-12 20:17:21 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 12 shan2batman 0 my second message welcome to chennai 2018-09-23 18:39:30 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 13 shan2batman 0 see what can i do to create a perfect social network 2018-09-23 18:54:54 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 14 shan2batman 0 lets see hi this is a test msg 2018-09-24 09:27:14 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 15 shan2batman 0 group post this is a test for group post 2018-09-24 09:28:46 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 289 man im having the best luck im going to be a billi... 2016-06-15 22:05:00 0 0 bye 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 11 shan2batman 0 ok lets see my first message #qwert 2016-08-12 20:17:21 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 12 shan2batman 0 my second message welcome to chennai 2018-09-23 18:39:30 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 13 shan2batman 0 see what can i do to create a perfect social network 2018-09-23 18:54:54 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 14 shan2batman 0 lets see hi this is a test msg 2018-09-24 09:27:14 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 15 shan2batman 0 group post this is a test for group post 2018-09-24 09:28:46 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 290 #qwert is it ready&lt;br /&gt;&lt;img src=&quot;ht... 2016-08-12 20:16:15 0 0 qwertyu 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 11 shan2batman 0 ok lets see my first message #qwert 2016-08-12 20:17:21 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 0 MEP news 12 shan2batman 0 my second message welcome to chennai 2018-09-23 18:39:30 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 0 MEP news 13 shan2batman 0 see what can i do to create a perfect social network 2018-09-23 18:54:54 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 0 MEP news 14 shan2batman 0 lets see hi this is a test msg 2018-09-24 09:27:14 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 0 MEP news 15 shan2batman 0 group post this is a test for group post 2018-09-24 09:28:46 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 291 &lt;img src=&quot;tinymce/js/tinymce/plugins/emoti... 2016-08-12 20:18:27 0 0 poiuytr 127 shan2batman shan2batman a <br><b>Shared via .<br> shan2batman WedDec715012120167478.png 127 0 MEP news 11 shan2batman 0 ok lets see my first message #qwert 2016-08-12 20:17:21 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 12 shan2batman 0 my second message welcome to chennai 2018-09-23 18:39:30 0 0 0 0 NULL NULL NULL NULL NULL NULL NULL 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 13 shan2batman 0 see what can i do to create a perfect social network 2018-09-23 18:54:54 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 14 shan2batman 0 lets see hi this is a test msg 2018-09-24 09:27:14 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 0 MEP news 15 shan2batman 0 group post this is a test for group post 2018-09-24 09:28:46 0 0 0 25 25 MEP news 2016-06-25 06:06:41 TueDec619191620165366.png 1 aboutthecreator MEP is a social network that aims to be like faceb... 296 hello #qwert 2016-08-12 20:21:10 0 0 test message! 127 shan2batman shan2batman a shan2batman WedDec715012120167478.png 127 1 2 | Show all | | Number of rows: 25 50 100 250 500 Filter rows: Sort by key: PRIMARY (ASC)PRIMARY (DESC)None Sorry if it is a bit too long
  6. @Barand but there are no ids matching the group between diferrent columns.
  7. here is the EXPLAIN output: @requinix id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE updates ALL NULL NULL NULL NULL 36 Using where; Using temporary; Using filesort 1 SIMPLE group_photos ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) 1 SIMPLE user ref PRIMARY,uname uname 52 const 1 Using where; Using index 1 SIMPLE group_posts eq_ref PRIMARY PRIMARY 4 project.user.user_id 1 Using where 1 SIMPLE friends ref friend_one friend_one 257 const 2 Using index condition; Using where 1 SIMPLE groups ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) 1 SIMPLE gmembers ALL NULL NULL NULL NULL 6 Using where; Using join buffer (incremental, BNL j
  8. it produces no results just empty rows. how can i share data with you to trouble shoot the problem???? @requinix
  9. here is my trimmed code for update select user.uname, friends.friend_one,friends.friend_two,updates.update_id,updates.update_body,updates.time,updates.title,updates.vote_up,updates.vote_down,updates.user_id_u,updates.account_name,updates.author, groups.name,groups.creator,groups.logo,group_photos.g_p_id,group_photos.avatar, group_photos.g_id, group_posts.gp_id,group_posts.pid,group_posts.author_gp,group_posts.type, group_posts.title, group_posts.data, group_posts.pdate,group_posts.vote_up, group_posts.vote_down, group_posts.user_id_g from user inner join friends on friends.friend_one=user.uname OR friends.friend_two=user.uname and accepted='1' inner join updates on updates.author=friends.friend_one and updates.author=friends.friend_two AND updates.author=user.uname inner join group_posts on group_posts.gp_id=user.user_id inner join gmembers on gmembers.mname=group_posts.author_gp inner join groups on groups.name=gmembers.gname inner join group_photos on group_posts.gname=groups.name and groups.name=group_posts.gname where user.uname='shan2batman'and groups.name="MEP news" order by time desc limit 10 i'll try to explain what i'm trying to do first i want to fetch friend_one and friend_two along with the session user uname value and fetch the results from updates table. second i'm trying to match the author names and group names stored in group_posts and fetch it along with the query.
  10. i'm trying it in phpmyadmin only @requinix and i don't think the code for dealing with the results is wrong as i copied it from functional queries scattered throughout the folder
  11. hi, i'm trying to fetch results from the following query manually in phpmyadmin but couldn't figure out how to fetch em as it outputs an empty result . The query actually fetches results two tables 1) updates table: which is where users post personal updates 2)group table : which is where group members post their updates in groups. the thing is mysql fetches a empty result but it should be bringing results from the tables as they have values in it. here is the db structure: -- -- Table structure for table `friends` -- CREATE TABLE `friends` ( `friend_id` int(255) NOT NULL, `friend_one` varchar(255) NOT NULL, `friend_two` varchar(255) NOT NULL, `friends_date_made` datetime NOT NULL, `accepted` enum('0','1') NOT NULL DEFAULT '0', `friend_one_uid` int(255) NOT NULL, `friend_two_uid` int(11) NOT NULL, `count` int(255) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- CREATE TABLE `gmembers` ( `gm_id` int(255) NOT NULL, `gname` varchar(100) NOT NULL, `mname` varchar(100) NOT NULL, `approved` enum('0','1') NOT NULL, `admin` int(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `gmembers` -- CREATE TABLE `groups` ( `g_id` int(255) NOT NULL, `name` varchar(100) NOT NULL, `creation` datetime NOT NULL, `logo` varchar(255) NOT NULL, `invrule` enum('0','1') NOT NULL, `creator` varchar(100) NOT NULL, `description` varchar(5000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `groups` -- CREATE TABLE `group_photos` ( `g_p_id` int(11) NOT NULL, `avatar` varchar(2555) NOT NULL, `g_id` int(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `group_posts` -- CREATE TABLE `group_posts` ( `gp_id` int(255) NOT NULL, `pid` varchar(16) NOT NULL, `gname` varchar(100) NOT NULL, `author_gp` varchar(255) NOT NULL, `type` enum('0','1') NOT NULL, `title` varchar(500) NOT NULL, `data` varchar(10000) NOT NULL, `pdate` datetime NOT NULL, `vote_up` int(255) NOT NULL, `vote_down` int(255) NOT NULL, `user_id_g` int(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `group_posts` -- and finally here is the query: select friends.friend_one, friends.friend_two, user.uname, updates.update_id,updates.update_body,updates.time,updates.title,updates.vote_up,updates.vote_down,updates.user_id_u,updates.account_name,updates.author, groups.name,groups.creator,groups.logo,group_photos.g_p_id,group_photos.avatar, group_photos.g_id, group_posts.gp_id,group_posts.pid,group_posts.author_gp,group_posts.type, group_posts.title, group_posts.data, group_posts.pdate,group_posts.vote_up, group_posts.vote_down, group_posts.user_id_g from user inner join friends on friends.friend_one<>'aboutthecreator' and friends.friend_two<>'aboutthecreator' and accepted='1' inner join updates on updates.author='shan2batman' and updates.author=friends.friend_one AND updates.author=friends.friend_two inner join gmembers on gmembers.mname=user.uname inner join groups on groups.name=gmembers.gname and groups.name="MEP news" inner join group_posts on group_posts.gp_id=user.user_id inner join group_photos on group_posts.gname=groups.name where gmembers.mname=group_posts.author_gp and groups.name=group_posts.gname and user.uname='aboutthecreator' order by time desc limit 10 pl help me to fetch results by correcting my mistakes in the query.
  12. @Barand i changed the query to something below but still the problem still it is not fetching results $query="select private_message.receiver,pm_notifications.message_id,pm_notifications.user_id_pm,user.user_id,user.avatar from pm_notifications" . " inner join private_message" . " on private_message.os_id=pm_notifications.os_id_pm" . " inner join user" . " on user.user_id=pm_notifications.user_id_pm" . " where private_message.receiver=:sess_id" . " and private_message.sender=:f_uname and pm_notifications.status=:status and pm_notifications.receiver=:f_uname" . " order by pm_notifications.pm_notification_id desc" ; //var_dump($query); $status='not_seen'; $stmt_pm_f=$conn->prepare($query); $stmt_pm_f->bindValue(":f_uname", $friend_username); //$stmt_pm_f->bindValue(":f_uname1", $friend_username); //$stmt_pm_f->bindValue(":sess",$_SESSION['id']); $stmt_pm_f->bindValue(":sess_id",$_SESSION['uname']); $stmt_pm_f->bindValue(":status",$status); $stmt_pm_f->execute(); $results_pm_f=$stmt_pm_f->fetchAll(); $total_row_f=$stmt_pm_f->rowCount(); var_dump($results_pm_f); var_dump($stmt_pm_f->rowCount());
  13. @requinix i changed the code to some extent for fetching results still it doesn't fetch them can you once again help mr???? here is my code: if($friend_username !=$_SESSION['uname']){ $query="select private_message.receiver,pm_notifications.message_id,pm_notifications.user_id_pm,user.user_id,user.avatar from pm_notifications" . " inner join private_message" . " on private_message.os_id=pm_notifications.os_id_pm" . " inner join user" . " on user.user_id=pm_notifications.user_id_pm" . " where private_message.receiver=:sess_id" . " and private_message.sender=:f_uname and pm_notifications.status=:status and pm_notifications.user_id_pm=:sess" . " order by pm_notifications.pm_notification_id desc" ; //var_dump($query); $status='not_seen'; var_dump($friend_username); $stmt_pm_f=$conn->prepare($query); $stmt_pm_f->bindValue(":f_uname", $friend_username); $stmt_pm_f->bindValue(":sess",$_SESSION['id']); $stmt_pm_f->bindValue(":sess_id",$_SESSION['uname']); $stmt_pm_f->bindValue(":status",$status); $stmt_pm_f->execute(); $results_pm_f=$stmt_pm_f->fetchAll(); $total_row_f=$stmt_pm_f->rowCount(); var_dump($results_pm_f); var_dump($stmt_pm_f->rowCount()); foreach ($results_pm_f as $row1) { if($total_row>0) { if($row1['user_id_pm']==$_SESSION['id']) { #there is no notifications echo '<a href="private_message.php?u='.$friend_username.'">' . '<img class="friendpics" src="'.$friend_pic.'" height="20" width="20" alt="'.$friend_username.'" title="'.$friend_username.'">'.$fname.' '.$lname.'<br>(' .$friend_username.')</a><br><hr>'; } else { #there is notifications echo '<span class="label label-pill label-success" style="color: white; float:left;">New</span><div style="background: #cce0cc; height:125px; width:100%;"><a style="text-align:center;" href="private_message.php?u='.$friend_username.'">' . '<img class="friendpics" src="'.$friend_pic.'" height="20" width="20" alt="'.$friend_username.'" title="'.$friend_username.'">'.$fname.' '.$lname.'<br>(' .$friend_username.')</a></div><br><hr>'; } } else { echo '<a href="private_message.php?u='.$friend_username.'">' . '<img class="friendpics" src="'.$friend_pic.'" height="20" width="20" alt="'.$friend_username.'" title="'.$friend_username.'">'.$fname.' '.$lname.'<br>(' .$friend_username.')</a><br><hr>'; } }} } } echo '</div></div>'; }
  14. @requinixfor some reason firefox with user1 shows results and chrome with user 2 doesn't show results while both users values are in the mysql table. And you are right the output comes with multiple rows any advice here will be valuable.
  15. i think the query isn't parsing. Atleast, that's what i think and it isn't outputting 0's and 1's as the $results_pm isn't fetching the desired values from the query.
  16. here is my current code no big changes except execution of query. $query="select private_message.receiver_uid,user.user_id,user.avatar from pm_notifications" . " inner join private_message" . " on private_message.pm_id=pm_notifications.message_id" . " inner join user" . " on user.user_id=pm_notifications.user_id" . " where private_message.receiver_uid=:sess_id" . " and pm_notifications.status=:status" . " order by pm_notifications.pm_notification_id desc"; //var_dump($conn); $status='not_seen'; $stmt_pm=$conn->prepare($query); $stmt_pm->bindValue(":sess_id",$_SESSION['id']); $stmt_pm->bindValue(":status",$status); $stmt_pm->execute(); $results_pm=$stmt_pm->fetchAll(); $total_row=$stmt_pm->rowCount(); var_dump($results_pm); foreach ($results_pm as $row){ if($total_row>0) { if($row['user_id']==$_SESSION['id']) { #there is no notifications $notify.='0'; } else { #there is notifications $notify.='1'; } } echo $notify; }
  17. ah i forgot to execute thanks a ton but still the ajax call returns a empty array bro where am i going wrong???
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.