Skip to main content
6 events
when toggle format what by license comment
Jul 8, 2012 at 23:28 comment added Clive For the types of queries you're running at the moment I think the Dynamic queries page is the best resource, it goes through all the options available. It's worth bearing in mind that you're already technically using the database API by using db_query, you're just not currently building a dynamic query. When to use either is a judgment call...db_query is a lot quicker, but db_select etc. let you build the queries dynamically which is good for some situations
Jul 8, 2012 at 22:49 vote accept Mrweiner
Jul 8, 2012 at 22:49 comment added Mrweiner Sorry about the last comment asking what was wrong...I had an extra apostraphe. I'm still curious about the Database API issue though. I know that there's documentation on Drupal.org, but any direction as to which part I need to be looking at would be awesome. I'm sure an API as large as that would be rather complex.
Jul 8, 2012 at 22:19 comment added Mrweiner That got rid of the error, but now it's not displaying or saving any values for the field Does anything about the structure of the COUNT part of the query look incorrect to you? @coleopterist - I'm not familiar with the Database API, as the advice I got when originally writing the field didn't include it. Do you have any suggestions on how to alter the query, or where to read up on using it instead of querying the database directly?
Jul 8, 2012 at 21:48 comment added user7667 To add to Clive's answer, when you run into SQL syntax errors, running the query in the MySQL command line or in PHPMyAdmin etc. will usually point you in the right direction in terms of debugging. Also the PHP in question does not conform to Drupal's recommended procedure when it comes to building queries. using the D7 database API might have mitigated this issue.
Jul 8, 2012 at 21:35 history answered Clive CC BY-SA 3.0