Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Or LEFT().
  2. You say output but then mention the POST hash... I'm confused.
  3. To get match rankings, you either need to use a full-text index (built-in or sphinx) or roll-your-own.
  4. That's not a subquery, that's a derived table... should be supported.
  5. You can't run 3 queries at once... at least not with the mysql_* libraries.
  6. Try this: SELECT t.tid FROM ibf_topics AS t LEFT JOIN ibf_posts AS p ON ( p.topic_id=t.tid AND p.author_id=1 ) WHERE p.topic_id IS NULL
  7. So, solved?
  8. This is definitely bordering on php only... use print_r() and see if you're getting the expect values for the DB.
  9. Only for tainted data going in.
  10. ISAM is ancient... MyISAM was its replacement many years ago. Try deleting the index file.
  11. Prove the queries are successful and return results.
  12. What are you trying to accomplish???
  13. if() statements aren't mysql-related... prove that the query doesn't fail... check mysql error, make sure some rows are being returned, etc
  14. I see lots of queries... what's not working?
  15. Why are you still using ISAM tables???? Convert them with: ALTER TABLE tblname ENGINE=MYISAM; Also, what does CHECK TABLES say? Does REPAIR fail???
  16. Don't try to store arrays in a single field... create one record for each tuple.
  17. It's not "extra", it's "mandatory".
  18. How about: DELETE a, b, c, d, e, f FROM a left join b on ( a.id=b.aid ) left join c on ( a.id=c.aid ) left join d on ( a.id=d.aid ) left join e on ( a.id=e.aid ) left join f on ( a.id=f.aid ) WHERE a.id='sdf' But I think there might be something wrongwith your table structure.
  19. This should help get you started: SELECT t1.col1 , t1.col2 , t1.col3 , t1.tdate , t1.t2agent FROM data AS t1 INNER JOIN ( SELECT tdate ,COUNT(t2agent) as t2agent FROM data WHERE MONTH(`tdate`) = '$month' GROUP BY t2agent ) AS t2 USING( tdate, t2agent )
  20. Actually, the real issue is that "desc" is a reserved keyword... you simply accidentally worked around the problem by using a table alias. Rename the column ASAP.
  21. I prefer starting each new column from the select list on a new line with a preceding comma; also, I like CONCAT_WS(): SELECT authors.author_id , authors.first_name , authors.family_name , CONCAT_WS( ' ', authors.first_name, authors.family_name ) AS author FROM authors ORDER BY authors.family_name , authors.first_name Just my $0.02 -- IMHO, it makes it less likely to make these kinds of syntax errors.
  22. Look at UNION statements.
  23. Add it before mysql_num_rows() -- try: $result=mysql_query($query) or die( mysql_error() )
  24. Yes, all of the relevant code is ideal -- but people see "all", not "relevant". I prefer to ask for "relevant code snippet", it seems to result in fewer code dumps. As for it being better than nothing at all, if we respond to code dumps, there's little incentive for OPs to go find the relevant section of code.
×
×
  • 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.