Jump to content

mikosiko

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mikosiko

  1. try this: SELECT u.userid,u.username,SUM(t.active),SUM(t.idle) FROM users AS u LEFT JOIN onlinetime AS t ON u.userid=t.userid WHERE u.activitycount = 0 GROUP BY u.userid HAVING SUM(t.active) < 100
  2. did you look in the "FAQ/Code Snippet Repository" folder? (in the main page of this site)?.... there are a few examples
  3. try to find the mysql config file in your old server and look at it... I will start from there... error seems to point to that server is not accepting remote connections
  4. google "phpinfo security" this is a related funny post.... and serious too http://www.eschrade.com/page/google-searches-4c067780
  5. first... you should modify your table composers... look your current definition and thinks about it.... one composer can compose multiples pieces right?... how your current table can manage that ? ... you should take out to another table the columns "name of composition" and "publisher id" and establish the relation between the composers table and this new table.
  6. what is the name of the file that you searched for?
  7. check in your OLD server the mysql cnf file (normally under /etc/mysql if linux server) if it has the directive skip-networking active... if so you can comment it .... restart mysql and try
  8. for your knowledge..... you ARE using JOINS.... only difference is you are using "Implicit JOINS" all those xxx = yyy ARE implicit joins
  9. explain the purpose of your point_list table please... and test this (no tested in my side... the SUM(c.POINT_RESULT) could be incorrect depending on the meaning of your table point_list) SELECT b.Club_ID, SUM(c.POINT_RESULT) AS TPoints FROM match2players a JOIN player2club b ON a.P2C_ID = b.p2c_id JOIN point_list c ON a.points = c.points JOIN match2tournamet d ON a.m2t_id = d.m2t_id WHERE d.tourn_id = $tournamentid GROUP by b.Club_ID ORDER BY TPoints DESC
  10. complementing my previous answer... you should look for the usage of mysql_field_name() and use it in the previous explained context. http://php.net/manual/en/function.mysql-field-name.php hope this help.
  11. your objective no make sense ... you should think again about your goal ... and think based on how SQL works... apparently what you want is select all the records where user_id = 5 and then you can choose to show or not the fields if the value = 1 (the name of the field is irrelevant because you can alter it every time you want (aliasing) ).
  12. you want the "FIELD NAMES" ?.... based on a condition where you are already using some of the field names?.... no make any sense.... maybe you are trying to get all the rows (values) where the condition is TRUE ?... post your table description
  13. most likely possible... post the code that you are using for that.... and additional your table's definitions a simple join should solve your issue if your table design is correct.
  14. $insert_city_query = "INSERT INTO sys_city_dev (ID, Mid, cityName, forder, disdplay, cid) VALUES (' ','" . $mid_id . "','" . $rows['city_name'] . "', '', '','')"; if (!$insert_city_query) exit(mysql_error()); } I don't see how record will be inserted.... mysql_query($insert_city_query) is not there
  15. Error is due to that you are selecting more than 1 column in your sub-queries... that is not allowed in that context.
  16. mikosiko

    mysql count

    my friend.... you have some spaces where you don't have to (note the spaces after SUM... those are wrong).. and you need spaces in others places (before FROM and ORDER) try: SELECT SUM( IF ( comments = 'pass', 1, 0 ) ) AS withComments, SUM(1) AS total FROM dsgi_serval ORDER BY SUM( IF ( comments = 'pass', 1, 0 ) ) DESC; and even when that statement is correct, I personally I will write it like this, considering that you want to have those counts grouped by make (as you posted in your first SQL): SELECT make, COUNT(*) AS total, SUM(IF(comments = 'pass', 1, 0)) AS withComments FROM dsgi_serval GROUP BY make ORDER BY COUNT(*) DESC; notice that for "total" I did use COUNT only because SUM and COUNT perform a little different... but both will have the same results for that specific field
  17. mikosiko

    mysql count

    post the sentence that was giving to you by Dan showing exactly how you have it right now (the one that is giving you errors)....
  18. mikosiko

    mysql count

    post the complete sentence that you have now
  19. mikosiko

    mysql count

    funny... but is ok... this: AS withComments, is not the same as:
  20. check the permits on /var/lock/hellavcr.pid
  21. then mysql_query is going to produce an error.... no
  22. gotcha... but that has nothing to do with MYSQl manual functionality.... Adobe is the one to blame I do use PDF-Xchange viewer since long time ago.... give it a try... is way faster than Adobe
  23. what kind of problem do you have with the pdf format?.... I have that and it work perfectly for me.. Index/bookmark/format everything looks ok to me
  24. absolutely... using your example: SELECT count(anything) FROM yourtable WHERE thisCol NOT IN ('enter', 'start', 'zero') GROUP BY whatever
  25. - How many records do you have in your dbase and letters tables? - There are indexes defined for both tables? (dbase.id and letters.maindatabaseid) - Did you run an EXPLAIN over your select to detect what is happening?
×
×
  • 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.