Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Preferably something with syntax highlighting at the very least, function lists, code folding, etc.
  2. Well, it's less than optimal, but it if works, go with it temporarily
  3. I don't understand.
  4. ENUM? What are you thinking? What do you mean "added to all rows"?
  5. Use this as your query: "select t.teamname, t.mail from ".$prefix."_teams as t inner join ".$prefix."_userteams as u on ( u.team_id = t.team_id ) where uid='$cookie[0]'"
  6. Why would you store the totals like that? And if you really wanted to, you'd need to run proper subqueries.
  7. Because you then need to move you where clause to the on clause.
  8. Thanks... much appreciated.
  9. I just gave you the query....
  10. Both of those code snippets assume that the part of the where clause you're building doesn't have ORs in it... and definitely use the array method.
  11. Um, there's no IS NULL there.
  12. fenway

    update price

    Or "= ROUND( 0.85 * pricecolumn, 2 )"
  13. If Home is a string literal, quote it.
  14. Then use aschk's code, switch to a LEFT JOIN and add "i.item_id IS NULL" to the where clause.
  15. You want the team name? select t.teamname from teams as t inner join userteams as u on ( u.team_id = t.team_id ) where uid=<the-uid-you-want>
  16. You can't select sum() like that.
  17. Well yes, you should be getting both name and id... you simply need to order your result set appropriately.
  18. Why not use MySQL's DATE_FORMAT() function?
  19. fenway

    delete and join

    You sure you selected the correct DB?
  20. fenway

    delete and join

    You can't have FROM twice! Drop the first one.
  21. Well, do you get into that isset() if statement? Did you echo the query string?
  22. Then you could simply self-join 4 times... that's what I tend to do.
  23. Then you need to store this info as a hierarchy... the way you've done it, with a "parentID", you can't write a query that will return a "unlimited" subcategory list -- you need to know the depth in advance, which is impossible. The adjacency list model might work.
  24. You really want DECIMAL, not DOUBLE.
  25. You still need indexes.
×
×
  • 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.