Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Well, if you're looking for "NOT in B", you'll need a left join -- and then use a IF(), check for NULL, and update your two fields accordingly.l
  2. Nope, that's the only reason... but it's better to simply avoid using any such keywords -- and the only way to know you've stumbled upon one if you leave the backticks out.
  3. Perhaps, but you shouldn't anyway. Looks fine to me, just grab the value of this column back in your PHP code.
  4. Sorry, I misunderstood your question.
  5. MySQL will handle the type "conversion" if necessary -- the quotes prevent SQL injection attacks.
  6. You mean your field is named 'date' -- that's going to be an issue too, since it's a reserved keyword. And you'll need DATE_FORMAT( yourColumnName, '%Y-%m-%d %H:%i:%s' ) AS uk_date
  7. That's your ENTIRE code block -- not very helpful. And yes, no need to repeat everything! Also, there's a space in your column name... difficult to work with in the long-run. what i'd like to see if an echo of $insertSQL along with your die() statement -- and figure out which one it is.
  8. fenway

    wait_timeout

    I would agree... it's like a connection_timeout, AFAIK.
  9. Post your INSERT statement.
  10. fenway

    SQL Help

    No problem... but why the second if?
  11. Well, yes, make a new table for the export... but I'd highly recommend a new field in the new database. It's going to be a disaster otherwise.
  12. Hold on a minute... are you outputting the uk_date field in your code? Chaged to (date)? What does that means? And TIME() won't work.
  13. There are a variety of hacks... but the best solution is to split first from last.
  14. $result = mysql_query("SELECT *, date_format(posted_date, '%d/%m/%Y') AS uk_date FROM $db_table ORDER BY time DESC LIMIT 3",$connect);
  15. Basically, this blog contains a regularly-updated run-down of MySQL functions, with a short description and a few hints on how to use them; RSS feed here.
  16. fenway

    SQL Help

    What you'll need to do is "change" the rec date for <7 days using an IF() statement, and then group by this column.
  17. Give an examplel.
  18. Add the previous expression after your *.
  19. First, you can issue an SQL query to find out. Second, I find it hard to believe that PHP can't spit out a different date format. But if you really need to, you can always convert the other way.
  20. You DON'T want to do this. Why corrupt the atomicity of each field?
  21. SELECT tier, hostname, platname FROM node AS n INNER JOIN node_platform AS np ON np.node = n.id INNER JOIN platform AS p ON p.id = np.platform Same for the fields, but I don't know which tables they're in.
  22. SELECT tier, hostname, platname FROM node INNER JOIN node_platform ON node_platform.node = node.id INNER JOIN platform ON node_platform.platform = platform.id I like to prefix field names and alias tables.
  23. fenway

    SQL Help

    There's a DATEDIFF() function.
  24. Where's the DB query for this 12 hour search?
  25. Use DATE_FORMAT() -- a mysql function.
×
×
  • 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.