Jump to content

gausie

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

About gausie

  • Birthday 02/17/1991

Contact Methods

  • Website URL
    http://www.pranking.co.uk

Profile Information

  • Gender
    Not Telling
  • Location
    A Syntax Error

gausie's Achievements

Member

Member (2/5)

0

Reputation

  1. SELECT E1.name AS name, E1.id AS id, E2.name AS parentname FROM categories AS E1 INNER JOIN categories AS E2 ON E1.parent_id = E2.id WHERE E2.parent_id = '0' ORDER BY E1.amount ASC So I want to limit the results from E1 (for each E2 record) to 5 only How can I do that? Gausie
  2. <script type="text/javascript"> function scrollPosition(){ if (navigator.appName == "Microsoft Internet Explorer"){ return document.body.scrollTop; }else{ return window.pageYOffset; } } function dirScrolling(prev) { var current = scrollPosition(); if (prev > current){ document.getElementById('c').innerHTML = "V"; }else if (prev < current){ document.getElementById('c').innerHTML = "^"; }else{ document.getElementById('c').innerHTML = "="; } t = setTimeout(dirScrolling(current),500); } </script> Why does this not change the div when I scroll?
  3. If I'm updating the innerHTML of a div from an AJAX call, how can I make the new content fade in rather than just appear? And I need to do this so that it is cross-browser compatable gausie
  4. How can I make it discout the "WHERE comment NOT LIKE '<i>%</i>%' " if the amount of comments for this article is equal to 1? gausie
  5. SELECT mak.id,mak.name,mak.rating,mak.votes,mak.user,COUNT(comments.comment) AS num_comments FROM mak LEFT JOIN comments ON mak.id=comments.about GROUP BY mak.id ORDER BY num_comments DESC LIMIT 0,10 That query is selecting articles (in the table 'mak') based on how many comments (in the table 'comments') they have. However, I haven now implemented service comments and would like to discout them from the counting. Any service message is like this "<i>%</i>%" and since there is no other way of putting <i> into the comments field, I am sure that these are all service messages. How can I add this condition to the query I have above? gausie
  6. Wait no :-( I tried to add a WHERE clause to picking from the mak table. I want sometimes to select only the articles with the "type" column having then value "item". I tried adding a WHERE mak.type = "item", but I got an error in MySQL syntax Laasst piece of help?
  7. Thankyou for your amazing help! Topic solved
  8. And finally, could it give a count of the comments as well?
  9. I tried to do this myself but no luck - I want to select each article, ordered by the most recent comment, and I want to return information about that most recent comment for each article. How do I do that? gausie
  10. That works - excellent! One last question: SELECT mak.id,name,mak.user,comments.date,comments.user,num_comments FROM mak LEFT JOIN comments ON mak.id=comments.mak_id LEFT JOIN (SELECT mak_id,COUNT(comment) AS num_comments FROM comments GROUP BY about)AS cc ON mak.id=cc.mak_id ORDER BY comments.date; How can I make it only return one (the most recent) comment? gausie
  11. I need to select all rows in my table that are duplicates. But the classification of being duplicates are if they have any other rows with the same "user_id" and "item_id". Even if the other columns are different, it is still a duplicate if those two are the duplicated anywhere. Can someone help me with this query? gausie
  12. Thanks for your help so far, by the way, you've been excellent!
  13. That's "mak" (the articles table) -> FieldTypeCollationNullExtra idint(250)[/td]Noauto_increment namevarchar(250)latin1_swedish_ciNo infolongtextlatin1_swedish_ciNo typevarchar(250)latin1_swedish_ciNo uservarchar(250)latin1_swedish_ciNo ratingint(250)No votesint(250)No dateint(250)No That's "comments" -> FieldTypeCollationNullExtra idint(250)Noauto_increment commentlongtextlatin1_swedish_ciNo mak_idint(250)No uservarchar(250)latin1_swedish_ciNo dateint(11)No[td] Hope that's enough information! (and date means timestamp ) gausie
  14. What do you mean by "comment value"? gausie
  15. Thanks so much for that help! COUNT(comment) - what is this "comment" referring to? If my comments table is called "comments", should that be "COUNT(comments)"? gausie
×
×
  • 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.