Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You didn't read my comment about the "alive" value before... quote it! In fact, quote all of your values! mysql_query("INSERT INTO `users` (username, password, email, activecode, activated, tut, status) VALUES ('$reg_username', '$randompassword', '$email', '$code', 0, 0, 'Alive')"); if (mysql_affected_rows() != 1) die ('Query failed: '.mysql_error());
  2. Well, you'ld need to quote "Alive"... but if you don't want the values, don't list the column name (assuming you have suitable defaults in strict mode, or strict mode is disabled).
  3. Even better, post the actual sql query, not the php variable.
  4. Don't put multiple values into a single field... that's a very BAD idea.
  5. This is more of a php question, really....
  6. Forget about adding another part -- write this separate query first.
  7. You need to use multiple order by clauses... do you still care?
  8. Lots... see here.
  9. Ignore the 3, it's meaningless. it's dispaly width.
  10. <- is an arrow. Actually, I guess you didn't actually read the article -- don't blame wildteen88. Anyway, since we can't guess what quoteInto does, it's hard to say... but since there are only two parameters, it appears that the placeholder will be substituted with "$url . %"
  11. You want: SELECT eventtable.EventID FROM eventtable LEFT JOIN usereventtable ON ( eventtable.EventID = usereventtable.EventID AND usereventtable.UserID='{$_SESSION['Current_User']}' ) WHERE eventtable.ActivateUrl='$Url' AND usereventtable.EventID IS NULL ORDER BY RAND() LIMIT 1
  12. Then I suppose TINYINT will do (UNSIGNED, probably).
  13. Then: ( (SELECT * FROM table1) UNION (SELECT * FROM table2) ) ORDER by date desc LIMIT 10
  14. OK... now what do you mean by "doesn't work"... generates an error, doesn't act the way you expect, etc.? I see no ON UPDATE / ON DELETE...
  15. I'm still quite confused... how can you aggregate on ID *and* include some values for "each" row?
  16. Usually it's in /var/lib/mysql... not sure how you could be missing those.... then again, it's a Mac, so I have no idea.
  17. You can use a CSV file directly as a mysql table... see the CSV engine type.
  18. If so, you can simply grab everything in the /data subdirectory -- each folder inside corresponds to an entire db, and within each of those folders are the MYD (data), MYI (index) and FRM (structure) files for each table. Stop your current server, copy them over into your new /data directory, and re-start.
  19. Why the group by ? Aren't the ID's unique?
  20. No, this is a php quoting issue.
  21. We can help you deal with one query at a time... like for instance, why is VIP not a DATE column to begin with? That's the slow part... and having a cron job isn't the answer. It's unlikely that's the only issue... turn on the slow-query-log and you'll see..
  22. No, you have to alias them, or don't use *.
  23. Sure.. but that doesn't limit to 10. Do you care where the 10 are from?
  24. No need to bump your post 3 times in 24hrs. Write a query to get all of the categories (e.g. with a group by), and then join this to the ordered products... it's that simple
  25. You'll need to count the number of matches and check it with a HAVING clause to filter out the others... and an IN() clause may prove helpful, too.
×
×
  • 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.