Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. What was the issue?
  2. You should be building your WHERE clause dynamically.
  3. This is a continuation of this thread... no need to start a new one next time. This is a VERY BAD idea... you don't need 10,000 tables for 10,000 users.
  4. So what is your point? It's better to use the COUNT function in the query rather than mysql_num_rows() function of PHP? YES -- that's exactly my point... if you only want the actual value of the count.
  5. You need a LEFT JOIN... IS NULL.
  6. Let's see it.
  7. Then you want: SELECT a.* FROM RQquestions AS q LEFT JOIN RQanswered AS a ON ( q.ID = a.qID ) WHERE a.qID IS NULL ORDER BY RAND() LIMIT 1
  8. Yes... use FIND_IN_SET().
  9. MySQL will tell you if the syntax is correct...
  10. No paren around the default value...
  11. Did you try count(arcade_games.champion)?
  12. Seems like rules 1 & 2 are the same...
  13. As long as you're ordering by the non-joined table, the order should remain the same.
  14. Define "not work"... no results, error, etc.?
  15. Depends on the query and the data... more info please?
  16. But you can using it a HAVING clause... and sometimes you can.
  17. Like paul said, as long as these tables should really exist separately, you're probably ok
  18. Why? What is the performance difference between mysql_num_rows and using COUNT in the query? If you query matches 10,000 rows, why send all 10,000 rows from the server to the client, create a PHP object, and then have to count them, when you can simply return a single number?
  19. fenway

    Normalization

    Depends... you could have this as another line item in the computers table.
  20. Sounds like you want a left join... but why the limit?
  21. So you have all of the lines, categories, parts, etc. in a single table?
  22. You probably want AND f.member_id IN ( instead of AND f.member_id = (
  23. It's not more work -- go back to modify your original query; for example: SELECT SUM(IF(DAmodeo='1',1,0)) AS DAmodeoCNT, SUM(IF(KArgyros='1',1,0)) AS KArgyrosCNT FROM DB_VOTES Obviously, you'll need to refer to the appropriate aliases in your php code, too.
  24. It's useful to separate data vertically if there are TEXT/BLOB fields that are rarely used, or the main table is read often, updated rarely... this will improve query cache performance.
×
×
  • 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.