Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Reinstall the software.
  2. Did you try "USE yourDB";
  3. I mean echo $query_topics.
  4. Two things: first, that's not the final query, echo the query as a string (after PHP variable interpolation). Second, remove the having clause, and check the value of your field.
  5. Do you mean like this? ... LEFT JOIN `task_user` m ON t.`task_id`=m.`task_id` AND m.`created`>='2007-11-01 00:00:00' AND m.`created`<'2007-12-01 00:00:00' ... I've done things like that in the past, but somewhere I read that it's best to have only the joining columns present in JOIN statements so I've been avoiding that. Yes, that's what I mean. Ideally, you don't want to have inequalities (definitely not != or not in) in the join condition, but ranges (i.e. BETWEEN) can be partially optimized, so if it's required for your query, it's fine. Oh... I call that a "derived table", to distinguish it from a subquery that refers to the "outer table". Just be aware that it's still temporary in memory, which means it's not indexed, even though the underlying table is.
  6. That's quite the detailed post! Nice job. Just two comments on the (edits) -- you can limit the time frame in the ON clause, no need for a temporary table. And most of the time, subqueries are slower than left joins.
  7. Why? is this not where product_id = 43 or parent_id = 43?
  8. It's not in the manual. Read the mysql manual -- it's a modifier to SELECT, like DISTINCT; after you issue your LIMIT query, call SELECT FOUND_ROWS(), and get it back.
  9. INSERT DELAYED.
  10. You'll have to decide how to find "duplicates" first.
  11. That's correct -- always try to see the output of expressions in the select list first.
  12. While the solution is syntactically correct, you're making a mistake by storing markup in the database like that -- a mistake you'll ultimately regret. Do this in the PHP output.
  13. Yes... use SQL_CALC_FOUND_ROWS.
  14. I don't see a where clause... and indexing on the UID won't help if you're not searching by uid.
  15. Then you want to UNION each inidividual select.
  16. I think a LEFT JOIN... IS NULL would be better...
  17. You could order by the different in dates with DATEDIFF().
  18. Just insert a record into a log table with a timestamp whenenver any user action occurs.
  19. That's not a valid SQL date -- use 2008-02-08 as a string literal, not with the DATE() function. The latter is for extracting the date component of the DATETIME column. ORDER BY CURDATE() will do nothing at all... ORDER BY eve_start_date will do as you say, it doesn't know anything about "closest".
  20. I'm not sure I understand why you're wrapping your date in DATE(). And I don't know what you mean by "approxmation".
  21. That would be quite slow.... why not flip it upside down and use a LIMIT OFFSET to skip the first 25 (which represent the last 25)? Of course, you'll need some sort of order by clause. @vcooldude832: Oh, and it's 1,2,3-trimethylbenzene a.k.a. hemellitol.
  22. There are many tutorials regarding uploading images and storing the required info in mysql.
  23. Because it can be fun, educational and you are in complete control. If you're doing this for anything other than fun/education, you should do it right. Otherwise, it doesn't really matter. Besides, lease a server, and you'll have complete control.
  24. Try this: SELECT nameField, COUNT( nameField ) AS occurence FROM yourTable GROUP BY nameField ORDER BY occurence DESC
  25. writing to network?
×
×
  • 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.