Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Not your work? REPLACE() can find certain parts of strings.
  2. You can't get back all the new IDs from multi-valued insert statements.
  3. That's the real problem. You can get fancy and figure out string-y ways do this... but it's much better to normalize your tables.
  4. Not entirely true... you can issue an ALTER statement with an ORDER BY clause, and then you don't need to use it explicitly -- but this is only helpful if the table doesn't change w.r.t this field.
  5. I think I know the problem... it's your CEIL() function... you're doing the rounding each time for the individual counts, but then once overall for the total, so you're getting different results.
  6. Sorry, I meant the entire variable... that is, the string literal you're producing -- switch to double-quotes for the php string, singles for mysql strings: $db->Execute("UPDATE products_licences SET orders_id='".$zf_insert_id."'" . " WHERE products_id='".$this->products[$i]['id']."'" . " AND orders_id IS NULL" . " LIMIT ".$this->products[$i]['qty']
  7. Why %? Why not localhost / remote IP?
  8. Interesting... have you tried GROUP BY... WITH ROLLUP?
  9. You need to quote that variable!!!
  10. You can number your results in PHP with a simple counter... that's not what UIDs should be used for.
  11. Show us the output from each individual query, then the combined query output so we can see what you actually want and what you're actually getting.
  12. Way too many queries... narrow it down for us...
  13. fenway

    SQL Limit

    You can't use negative values anymore, so try LIMIT 5, 999999999999. Or whatever the max number is.
  14. Where did that INSERT statement go? Where did this SELECT query come from?
  15. No, I meant that the actual value you're inserting has a corresponding record.
  16. Are you sure the state_id exists is the states table?
  17. Do the inidivudla queries work?
  18. So it was the insert statement? Which mysql statement was the trigger?
  19. No... you'll have to do it in 2 queries.
  20. This must be a PHP issue....
  21. You should probably consult the mysql refman on triggers...
  22. Why can't you see it? error_reporting()? mysql_error()?
  23. I suppose you could use user variables to figure out when you're reached three, and filter accordingly.
  24. Or you could simply query a single db.
  25. There's NO WAY your company requires }//end if statment Anyway, you should get all "root" usernames that match first in an sql query, and then generate a random one, and check it against that list.
×
×
  • 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.