Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Why not use TEXT fields?
  2. I didn't know IE ever respect such attributes properly.
  3. The main site has been temporarily shut down and is being rebuilt... sorry for the inconvenience.
  4. Yes, agreed... I really wish mysql wouldn't do this silently (well, I guess it doesn't in v5).
  5. There's a --skip-networking option in the my.cnf file too -- in which case the grant won't help, AFAIK.... but you can troubleshoot by allowing *, but without ALL. Select privileges alone will allow you to log the IP.
  6. And a mysql_error() call after that, just in case.
  7. You're right, I just re-read the initial post again... hard to decide how to "match up" the out_date/check_date pair prices with each other.
  8. I'm going with ©.
  9. It will work if you add an ORDER BY <yourField> LIMIT 1... just decide which price you want.
  10. Your user may not have access from this domain... or from any domain, for that matter.
  11. So add one.
  12. It's a quoting issue... switch to single quotes for your concat.
  13. That is all JS.... document.all is faster than getElementById... and you could go searching for class, but if you know it in advance, there's no point. If you're missing some letters, you can simply check for the id before you continue.
  14. I meant to generate it on-the-fly in sql using an integers table....
  15. My bad, your group by should be on ref_date.date, that will eliminate the duplication. But still, you're going to need to generate that date sequence.
  16. A few more things... -you should be using ref_date.Date in your select column list, i.e. from the non-left joined table, for the reasons mentioned above. -you shouldn't use "date" as the column name, it's a reserved keyword, and it works by accident because you have prefixes -you can use DATE() to just extract the date part of the datetime field; I think mysql might do this silent type converstion for you, but I prefer it to be explicit; date() reads more cleanly I also didn't really understand what you wanted until right now. What you need is to generate a sequence of dates between the first date and today, and use this in your joins. You can use an integers tables with date_add() from the initial date.
  17. A few things: 1) Don't use date_format in GROUP BY / ORDER BY clauses. Morever, GROUP BY does an implicit ORDER BY. 2) Because your where clause includes a reference to the left-joined table, you've effectively made this an inner join again. You need to add this condition to your on clause instead. 3) Haven't followed the whole thread, but you should really use proper date column types for all of your dates, not varchars. So: SELECT date_format( Transaction.Date, '%Y-%m-%d' ) AS 'Date', count( * ) AS 'Sales' FROM ref_date LEFT JOIN Transaction ON ( ref_date.Date = date_format( Transaction.Date, '%Y-%m-%d' ) AND Transaction.gigID = '1' ) GROUP BY Transaction.Date
  18. You need to use mysql_fetch_result( $pixie, 0, 0 ) or mysql_fetch_assoc() and the grab the otal_non_empty_s1t1 hash key.
  19. You just want a different number for each one, right? This can be accomplished with the above... and if you're using a new version of mysql, then I believe that you can set the values of additional columns that aren't in your column spec in-line.
  20. Why not use FLOOR( RAND() * 100000 )?
  21. Why not validate this in the app?
  22. As I recall, this may be due to different data type in a FK definition.
  23. Define "doesn't work" -- db error, strange results, etc.
  24. Just remember that this isn't thread-safe.
  25. The "not good" is for at least two reasons: one, not all users have delete permissions; two, if this UID is used as a FK in a MyISAM table, it will break the relationship.
×
×
  • 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.