Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Or, use mysql for what databases are for... add a UNIQUE index, and use insert ignore.
  2. There is no such thing as a "php subquery" -- you mean a nested loop, which is bad. And yes, pre4.1, no subqueries. That's why we ask you to post your mysql version at the outset. why would it be better to derive a new table ? So that you don't have funny subquery issues with syntax or optimization or execution. Try this -- also, you should get used to using proper ANSI join syntax, makes it so much easier to read: SELECT d.* FROM data_table AS d INNER JOIN _data_section_link AS _dsl USING ( data_id ) INNER JOIN section_table AS s USING( section_id ) INNER JOIN ( SELECT d.data_id FROM rds_table AS r INNER JOIN data_table AS d USING ( data_id ) INNER JOIN _data_rds_link AS _drl USING ( rds_id ) WHERE d.data_status = 'current' AND r.rds_id = 1 ) AS derived USING( data_id ) WHERE s.section_id = 2
  3. Look a the PCI compliance stuff for credit card numbers and CVVs. Same idea.
  4. Or, store it like a date, since it ACTUALLY IS A DATE.
  5. I don't know what you mean by that... an interval can't be an inequality... but you can use an inequailty in your comparison. and there is a "1 HOUR" option too.
  6. I don't see how that can possibly be true. How to use it? What do you mean? Order by ID? huh?
  7. Why not just UNION the tables/
  8. Very confusing that your PK / FK don't have the word "id" in them -- also, I'm not sure how you're relating bowls to picks... using the name of the bowl? why not the id???? Does this seem to work? Obviously, "*" isn't appropriate here, but you get the idea. select fp.*, fb.*, fta.*, ftb.* from foot_picks as fp inner join foot_bowls as fb on ( fb.name = fp.bowl_name ) inner join foot_teams as fta on ( fta.team = fb.team_a ) inner join foot_teams as ftb on ( ftb.team = fb.team_b ) where fp.user = '$user'
  9. If you can connect to that database, then yes.
  10. That syntax before was incorrect... try SELECT CURRENT_TIMESTAMP() + INTERVAL 15 MINUTE
  11. you need to escape the quote -- look at mysql_real_escape_string()
  12. 5 values in one field? You should normalize ASAP!
  13. Your script refers to 3 tables...
  14. But please don't use reserved keyword for field names!!!
  15. Yes, you'll need to join all these tables, twice for each team table. Show us your complete DB structure.
  16. The problem is that you need to extract a field value to determine a table name, which is impossible to do using standard SQL. Depending on what you're doing, it may be "easier" to have a transcaction log for each tyep of device, and then UNION them all.
  17. That has nothing to do with mysql.
  18. ORDER BY IF( age >= 16, 0, 1 ) ASC
  19. Which version of mysql are you using -- checking for subquery support here. Either way, it would be easier to re-write this using a dervied table.
  20. First you need to decide how you want to aggregate the company_ids.
  21. Restart the server with skip grants.
  22. Nope... it reloads the grant tables so that your changes actually do something.
  23. 1. You can't have this magic work on its own. 2. Ditto. 3. Unknown. The question really is why have the devices table at all....
  24. Sigh... don't people use redirects?
  25. Don't forget to FLUSH PRIVILEGES.
×
×
  • 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.