Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Seriously? You just threw away the sprintf() function.
  2. Just re-save the new order
  3. Empty strings aren't valid integers... I assume you have strict mode on.
  4. You need UTF-8 charsets.
  5. Yes, and * will return garbage when used with GROUP BY -- as you've discovered. Like I said, take the details of your "latest" or "max" comment, and find that comment again in the comments table, without a group by.
  6. What you need to do is not mess up your DB normalization -- you need a third table to relate members to offices.
  7. You need to JOIN these tables: SELECT m.memid, m.surname, m.fname, m.email, o.abbreviation FROM members AS m INNER JOIN offices AS o ON ( o.officeid = m.office )
  8. You're almost there... but you can't get back * -- it's meaningless. Once you have the value for the last comment, you need to join back to the comments table.
  9. Then post those two.
  10. In theory, you can put 0 or NULL, but you shouldn't do either.
  11. NULLs work too.
  12. What does this have to do with a left join?
  13. This is really a php question.... I will move it shortly.
  14. You can *always* use a table.
  15. Your field name has now changed on the html input form.
  16. I believe you're looking for UNION.
  17. Assuming you're working with case-insensitive collations (the default), UPPER() shouldn't matter.
  18. You mean like: WHERE first_name LIKE 'a%' ?
  19. If there's no max, then don't include that criterion in the search.
  20. Not an option... try again.
  21. Try this: SELECT StudentTable.* FROM StudentTable LEFT JOIN EnrollmentTable USING ( StudentID ) WHERE EnrollmentTable.StudentID IS NULL
  22. Don't know... try both.
  23. Well, I don't know about the php part... but you'll need a LEFT JOIN if you want back records without matching rows.
  24. I was looking for the latter. You should not include fields that aren't being searched... you can use php to figure that out. And for your validmenu options, you need implode, not explode.
  25. First, your query should look like this: SELECT rua.reg_users_ads_id, rua.year, make, model, rua.trim, rua.price, rua.exterior_color, rua.transmission, rua.mileage, rua.zipcode FROM reg_users_ads AS rua INNER JOIN atrMakes AS ma ON ( rua.atrMakesID = ma.atrMakesID AND ma.atrMakesID = '65' ) INNER JOIN atrModels AS mo ON ( rua.atrModelsID = mo.atrModelsID AND mo.atrModelsID = '712' ) WHERE rua.zipcode IN ('75023','76888','76888','76888','78722') AND status = 'active'; You should always specify a table prefix ... like for zipcode and status (the latter of which I can't even guess. But I get the feeling you have no indexes.
×
×
  • 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.