Questions related to SQL queries, used in a module to retrieve information in a database table.

learn more… | top users | synonyms (1)

0
votes
0answers
16 views

Ubercart adjustments query hangs up

Recently found a bug in my system which uses ubercart, such that whenever I click on adjustments tab of specific product edit page, the cpu utilization for mysql shoots up to 100% for some reason. I ...
2
votes
1answer
21 views

Is it possible to divide two columns using the the query builder?

Is it possible to divide two columns using the the query builder? Like: $query -> fields('A', array('valsA') / 'B', array('valsB'));
2
votes
2answers
31 views

General error: 2006 MySQL server has gone away

This is the error I am suddenly getting. Additional uncaught exception thrown while handling exception. Original PDOException: SQLSTATE[70100]: Unknown error: 1317 Query execution was ...
0
votes
3answers
47 views

Pulling data into a content type

I'm hoping to get some opinions on the best way to proceed. We are migrating our website from a Microsoft Environment to Drupal 7 and I appear to be having trouble wrapping my head around how to do a ...
0
votes
1answer
20 views

View/query to show latest node related to each term in a taxonomy vocabulary

I have a node type (stories) which is related to a taxonomy vocabulary (countries). Each story is related to one country only. I want to create a view of the latest story from each country, ordered ...
0
votes
1answer
34 views

Check for field values to be unique when storing into the DB

I have a content type "Research assignment" which has several fields including the field "field_user" and "field_project". I want to remove any old research assignments having the same user and ...
2
votes
1answer
30 views

Placeholders and the query builder?

I read on the drupal.org site: "Never put a literal value or variable directly into a query fragment, just as literals and variables should never be placed into a static query directly (they can lead ...
1
vote
1answer
37 views

Database Query to test new users

In my Drupal 7 site, I inserted values into the 'surname' and 'date of birth' fields of my database tables. I want to prevent new users whose username and date of birth do not match those on my ...
0
votes
1answer
98 views

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fmotors_fms.block_node_type' doesn't exist:

This was working fine last night but when i login to my computer again I got this error now. What is this table {block_node_type} I cant find it in the database but it is in the drupal code in ...
2
votes
1answer
31 views

how to groupby with rollup in drupal 7

how to get booking records from booking table .how to get group by function with ROLLUP SELECT * FROM booking GROUP BY startBooking WITH ROLLUP; how to convert above query in drupal 7? ...
1
vote
1answer
16 views

EntityFieldQuery for getting the count of a user blog

EntityFieldQuery for getting the count of a user blog. Blog is a content type.
1
vote
0answers
29 views

Performance Implications when Views JOIN added twice?

I have a view with a flag (relationship, only show flagged nodes). I have modified it a few times and now I see in the query output that views has the join added twice: INNER JOIN {flag_content} ...
0
votes
1answer
62 views

Join multiple tables in D7 Views

I'm trying to create a View Block to display related information on a node. I'm creating an image gallery where each image node is tagged with one/more taxonomy terms, and a block on each of those ...
1
vote
3answers
48 views

How can I get count of deleted rows

How can I get count of deleted rows after db_delete? db_delete('node') ->condition('uid', 1) ->execute(); something like $count = db_delete('node') ->condition('uid', 1) ...
0
votes
0answers
48 views

How to remove and add joins to a view?

Because of some buggy handlers I need to write a hook that will: Get location_instance table's alias from the original query Remove location_instance table join Remove that alias join Remove a ...

1 2 3 4 5 15
15 30 50 per page