Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Sections? Please clarify.
  2. fenway

    SQL SUMs

    No mysql_error()?
  3. Sorry, I was thinking about something else. What version of mysql? SET clause is only supported as of v5.0.3
  4. I'm still confused... yes, some of the SET fields are expressions, so they're required... but why just the assignments? And where are those user variables set?
  5. Posting the entire code doesn't help since we don't know what we're looking for. However, since your JS code references a field called "1stLeft", and your select widget is called "1stLeft[]", it's not going to work.
  6. Broke how?
  7. That error doesn't match that query.
  8. I'ts not a game... specify a table prefix.
  9. Well, yes, if you retrieve the list if unique product IDs first, that would work with a RAND() and LIMIT 3. The other way would require sorting the product table, and then only taking 3 of each.
  10. You can start mysqld without the grant table loaded....
  11. You're taking about dynamic drop-down values? Many such tutorials are available.
  12. You still can... ;-) No, you need to put the matching DB column name in the column list -- mysql never "sees" the CSV columns (in fact, you need to skip the header line if it is present). You can also skip fields you don't want imported. You can also manipulate them with the SET command (in some later versions).
  13. Could you post the EXPLAINs of the equivalent select statements?
  14. First, that is not the only example of sql injection. Second, there are other functions that do support multiple queries (or so I am told).
  15. Yes, but not in the same columnar format as the db table. It doesn't have to be... that's why you specify the the columns for the DB in the order of the CSV file headings. Which is why I said you need column names, not values. Make sense?
  16. Wasn't it in a CSV file?
  17. The error you posted above shows DATA in the column specification! These should be column names only -- you shouldn't have variables there.
  18. You don't understand what I'm saying... that list is the list of COLUMN NAMES, not the list of values.
  19. How about.... IF( COUNT( `result` ) = 0, 0.500, ROUND( SUM(IF(`result`='Win',1,0)) / ( SUM(IF(`result`='Win',1,0)) + SUM(IF(`result`='Loss',1,0)) ), 2 ) ) AS `percentage`
  20. Those aren't column names, those are field values.... what gives/
  21. Ok, now I understand... that error was from the suggestion, not the original query. But I'm also confused... what's the issue right now?
  22. Output how? Post the code you're using the display the result of this query.. all I see above is the query() call.
  23. How does it "not do the trick"? The query executes correctly, right? You need to use fetch the appropriate columns, though -- you should add column aliases and use mysql_fetch_assoc().
×
×
  • 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.