Tagged Questions
0
votes
1answer
27 views
Update Mysql table row
I'm new to Drupal and its SQL API, and I am trying to update a row in a table I created.
// Admin form
function admin_Form($form, &$form_state)
{
$dbval = getVals();
$form=array();
...
0
votes
1answer
15 views
Custom DatabaseConnection driver does not get found by drupal!
I need to customize a method on the DatabaseConnection_sqlsrv (MSSQL) driver, so i created a new driver class called DatabaseConnection_sqlsrvseed and extended all depended classes from the *_sqlsrv ...
1
vote
1answer
19 views
Best way to make an EntityFieldQuery query be case sensitive?
The case-sensitivity of queries created using EntityFieldQuery rely on the underlying database's collation [*]. So if the collation for a particular field is 'utf8_general_ci', then all the queries ...
1
vote
1answer
37 views
What is a one line mysql query that can update all body fields of matched nodes?
I am trying to do a bulk node update that affects 100+ nodes. I want to set each of these node's body field to a specific string. Say I want to affect all content types: "basic page".
Since my sql ...
2
votes
1answer
32 views
What module will show me all sql queries being run on the loaded page?
My site is running slow and I suspect its a module, but not sure which one. Is there a module that can display all the sql queries being run on a loaded page? If there isn't maybe there is a command ...
0
votes
0answers
25 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
2answers
201 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 ...
1
vote
1answer
158 views
Delete all nodes from database except from user1 and admin
I have got thousands of junk entries in my Drupal 6 website. Is there a way I can Delete all nodes from database accept from user1 and admin.
I also want to delete all users accept user1 and admin.
5
votes
2answers
296 views
How do I add an OR expression between two ->addExpression() in Drupal 7
I am trying to return flagged content that is either flagged as a favorite or flagged as visited. I can get them to return but i believe Drupal is doing an and between the 2 addExpression() in the ...
0
votes
1answer
114 views
What is the database relationship between node_type and taxonomy_vocabulary tables?
I have 3 content types. I have 3 vocabularies - one for each content type.
Recently I have created a script to save nodes programatically based on batch files clients send me. I am very happy with ...
1
vote
0answers
43 views
why are nodes not being reassigned to new term when termid is changed?
I'm having to create new taxonomies for a client and they want nodes that are associated with these terms and taxonomies to be assigned to the new taxonomy, I have done this via MySQL with an update ...
1
vote
2answers
349 views
Database Abstraction Layer and 'LOAD DATA INFILE' Statements
I realize that using the database abstraction layer comes with a few caveats such as not being able to run queries that are not available in one way or another across all versions of the databases ...
0
votes
1answer
380 views
Extracting Views SQL
I would like to create a MySQL view for another application looking at the Drupal Database. I thought I would get a jump start on figuring out the select statement needed by creating a Drupal View, ...
1
vote
1answer
2k views
How to clear cache using an sql query in Drupal 7
After a module update, my site has become un-usable, and only shows a php error message.
I tried circumventing the problem with drush cc, but that didn't help.
Also tried with a custom php script but ...
1
vote
2answers
104 views
Combining 2 Queries to pull titles of 2 related content types from the node table
Time to put our database hats on! We have a complex database call that responds to an AJAX request. We've omitted most of the code to just include the portion that is giving us trouble. We are working ...
0
votes
1answer
1k views
Drupal 6 & Custom query sanitization
Reading through Drupal 6 docs, it appears that db_query and db_query_range take the entire query.
This is different from Drupal 7, which can separately take user input as an argument, effectively ...
1
vote
2answers
321 views
db_query() function in a foreach cycle - only the first query is getting executed (D6)
I have a query, which I have to run in a foreach cycle.
I run the query with db_query() function.
My code looks similar to this one (of course, this is just an example code with example values):
...
3
votes
2answers
876 views
Can you bulk enable comments?
I have a whole bunch of nodes (all the same type), and I'd like to turn comments on for all of them (the client changed their mind about commenting after all of the data was added).
I've found notes ...