Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Sorry, my bad about the parens.... try: $query = "SELECT * FROM books WHERE title LIKE '%$posted%' AND zip = '$zip' AND city = '$city' AND state = '$state' AND country = '$country' ORDER BY ( zip = '$zip' ) DESC, ( city = '$city' ) DESC, ( state = '$state' ) DESC, ( country = '$country' ) DESC";
  2. No, don't report -- check with echo() statements that you're getting where you expect first.
  3. $result is a recordset... echo mysql_result( $result, 0 0 )
  4. Yes, you can do this: $query = "SELECT * FROM books WHERE title LIKE '%$posted%' AND zip = '$zip' AND city = '$city' AND state = '$state' AND country = '$country' ORDER BY ( zip = '$zip' DESC, city = '$city' DESC, state = '$state' DESC, country = '$country' DESC )";
  5. As per the manual: "If the return set has no rows, SUM() returns NULL." Try: SUM( IFNULL( t2.salary, 0 ) ) as t2total
  6. Sigh... I wish ONLY_FULL_GROUP_BY was part of the default SQL mode.
  7. Your last problem was a PHP issue... this maybe as well. You need to check that you're actually getting into the block that deletes from the DB -- and that the query runs.
  8. Please don't mark topic "solved" unless you post the solution for the benefit of others.
  9. I see the two commas. But how do I get to change that. Where does the line come from? mySQL? should I change somethin in the database or does the error come from wp? MySQL is being told to run a query by WP -- so you'd have to figure out which file is doing it, but this sounds ilke an error on their part.
  10. I can only guess what you mean by "this" and "it"... mysql won't let you automatically query EVERY field in a table. That's what full-text is for.
  11. What was wrong with the supplied code?
  12. Drop all those backticks and you won't get any syntax errors. Then you need to move some conditions on the B table to the ON clause -- possibly all of them (untseted) SELECT count(*) FROM cpLinkedProducts as A left join cpProductsValues as B ON (A.id_product = B.id_product AND B.id_productfield = '2' ) WHERE A.id_category = '21' AND (`B.value` LIKE 'a%' OR B.value LIKE 'b%' OR B.value LIKE 'c%');
  13. fenway

    search help

    Please echo the sql query and post it here so that we can see why it doesn't work....
  14. No longer the default as of version 5.
  15. I'm confused about fletch and plank -- what do those mean? why are there booleans being stored in INT columns?
  16. Since we don't know your table structure, we can't guess.
  17. fenway

    SHOW COLUMNS

    You could do this with the I_S tables in v5, but you'll need to clean it up in php anyway, so why not just start there/
  18. fenway

    search help

    The query you're using to search.
  19. I'm so very confused... your grouping by job_id, not user_id?
  20. It sounds like you're checking the left joined table's fields in the where clause, which would have been NULLed out, so that might explain it... hard to tell without table prefixes.
  21. Very close -- but you really should name those uid fields "user_uid" to make it clear: SELECT u.first, u.last FROM users AS u LEFT JOIN resp AS r ON r.uid = u.uid WHERE r.uid IS NULL;
  22. Yeah, it's a burtal process.
  23. Could you elabortate a bit more?
  24. You need to use a transaction table... or you can cheat with myisam tables in a variety of ways.
  25. Actually, you should jeft join and use IFNULL to decide.
×
×
  • 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.