If the question is about SQL queries, consider using "sql-queries"; if the question is about the database API, use "db-api."

learn more… | top users | synonyms

0
votes
1answer
20 views

Why does a try block affect drupal_set_message?

I have a try block set up: try { //some code throw new Exception ( 'My exception message' ); } catch ( Exception $e ) drupal_set_message('Caught exception: '. $e->getMessage(),1);} But ...
-2
votes
0answers
10 views

write custom pagination with drupal 7 static query [closed]

i am stuck in between as i am writing a custom query to fetch the result the query runs fine and outputs the result as wanted but i want a pager in the result . The query i am writing is the static ...
2
votes
1answer
26 views

Multi-site installation with shared database but different user table

I need to install drupal multi-site with shared database but just need to create some tables specific to that site like, users table should be different for sub-sites. I know about full sharing or ...
4
votes
3answers
112 views

Whats faster db_query, db_select, or EntityFieldQuery

So I'm trying to find out what is faster db_query, db_select, or EntityFieldQuery. Currently I'm using EntityFieldQuery. I'm grabbing about 1600 node entries. I realize this can be taxing on the ...
1
vote
1answer
13 views

Merge production site's content into staging through database tables

I am working on a major upgrade on my website which includes several new modules being installed, various theme changes, updates on existing modules and a few modules that were uninstalled. All the ...
-1
votes
1answer
25 views

Fatal error: Cannot use object of type stdClass Error help!

When trying to access my image file from my database i get this error: Fatal error: Cannot use object of type stdClass as array in ...
0
votes
1answer
25 views

Submit data into database

I have read a great deal and trying to learn how to get data into a table in the db. I have the below code to test entering just the first name of someone and I am getting an error. I have tried to ...
1
vote
1answer
48 views

Drupal 7 special chars not working in db_select

I have implemented custom search to get some values from node. When I'm using special chars like "/, ?, !", no result is being displayed. Example value : "24/7" or "site?" or "test!", etc... ...
0
votes
1answer
20 views

How to save a form inputs in database and retrieve it from database with out form submision

hi can i store form inputs in database and retrieve it from database with validation I search many sites but neither any documentation or example or any thing i found for drupal7 . I didn't ...
0
votes
1answer
40 views

Drupal issues - DB and modules in folder that doesn't exist

Ok, so I ran into an issue today that completely baffles me... I have a staging server that I have about 30 sites on. Most are WordPress and about 5 are Drupal. Yesterday I worked on a Drupal site ...
1
vote
1answer
177 views

User with uid=0 in database

I had to build a form with a select field populated with all the users registered in database. There are 10 users that I can see in admin>people. To get all the users, I used entity_load('user'). ...
3
votes
1answer
72 views

Can I rename a module?

I foolishly created a features module and named it events. This is bad because, of course, there is a registered module with that same name. So the update status report is always in error and drush ...
0
votes
1answer
28 views

Drupal entity from different database

I have an existing database (which is not under my control) that i want to use as base database for my entity. However I'm stuck at getting the data from the database. There already exists a question ...
0
votes
1answer
23 views

How to trim content from a heavy database

I would like to trim content from a heavy production database (1GB), to reduce transfering time, local mysql import time and generally make it easier to work with. I know I can ignore cache, watchdog ...
2
votes
2answers
20 views

Possible to access source database in prepareRow() in Migrate module?

I'm doing a D2D migration that requires a mapping table to map tids from the source site to the destination site. In prepareRow(), I need to check the tid for a certain vocabulary and get the ...
2
votes
1answer
27 views

MySQL date format functions in Drupal

How can I do a MySQL date function in Drupal? I have this now: $select = db_select('someTable', 'st'); $select->addExpression('DATE_FORMAT(FROM_UNIXTIME(created), "%Y-%m")', 'createdMonth'); ...
7
votes
3answers
166 views

Site performance , cache not working properly

I am using the Performance Logging Module. Above screenshot, one strange thing I noticed that Insert Cache_bootstrap on every page. When you go to any page (both admin theme and frontend theme) ...
1
vote
1answer
16 views

How to extract query placeholders for debug purposes?

When I cast query to string, I can see WHERE that will be passed to the database, like this: WHERE (idProperty = :db_condition_placeholder_0) AND (idCategory = :db_condition_placeholder_1) But ...
1
vote
1answer
18 views

Creating a vanilla instance from a site already set up

I have a Drupal site which is set up, running and being continuously used. It has a variety of content_types, taxonomies and field_collections etc saved in the database. The plan is to sell on ...
0
votes
1answer
19 views

javasript invoking custom module to update user response

I have created Multiple choice questions in drupal . One node (page ) has one mcq . The answers are displayed by simple radio buttons and javascript . Now I am planing to give some dynamic behavior ...
0
votes
1answer
12 views

How to prepend a Views query with another query?

Due to a configuration problem at my host, I'd like to execute the query "SET optimizer_search_depth=0;" in the same DB session as a specific Views query. I looked into hook_views_query_alter() and ...
1
vote
2answers
36 views

Splitting up a Drupal database

Is it possible to split the Drupal database into multiple databases. For example I have one database having the watchdog table and another database having all the other tables? I know if I created my ...
0
votes
1answer
29 views

changing unicode characters in a module

There are hundreds of records in a database that are in windows-1256 charset, I want to read these data and convert them to utf8 then insert them in a new table, to read these data I need to change ...
0
votes
1answer
26 views

Shared database during development?

Sometimes I need to collaborate with a more frontend-centric developer to help implement a site. So typically they're only changing CSS and minor template changes. The way we've handled this in the ...
0
votes
1answer
16 views

Schema relationship

The problems I am trying to solve are: 1- How can I connect tables defined by $schema to each other? 2- How do you insert data consistently into the database? Is there any possibility of having ...
0
votes
2answers
26 views

How add/update a record conditionally based on existence of primary key?

I have a table with structure: Table ( record_1 int, record_2 int, PRIMARY KEY (record_1) ); I want to write/update a record based on its existence. I was told to use drupal_write_record(), but for ...
0
votes
1answer
26 views

Changing Drupal database

How would you think if a designer extends the database of Drupal for a desired system? (for example adding field to some tables) Would it be really PRACTICAL?
0
votes
1answer
13 views

Bulk change radio button setting in admin/content using database

I am using a paywall module called TinyPass where I have to check a radio button in order to activate the paywall for a specific node. I now have a situation where I want to uncheck (or deactivate) ...
0
votes
1answer
10 views

Database error after transferring Drupal 6 site

I just moved a Drupal 6 site from one server to another and have just started getting an error. Warning: Table 'mydatabase.watchdog' doesn't exist. The table does exist in the database and it does ...
0
votes
1answer
15 views

Why does user column name has UNIQUE Constraint?

I got aware that the column name in TABLE users has a UNIQUE Constraint, when I tried to register a 2nd user with the same username : it returned a `integrity constraint violation 1062 duplicate entry ...
0
votes
1answer
41 views

How can I make Drupal/MySql accept special characters in ANSI (without changing the file's encoding)?

I'm developing a custom module where a user (actually an admin of sorts) can upload a CSV file. Based on the contents of this file, certain rows are inserted into a table. I'm now having problems ...
0
votes
0answers
11 views

Why does create node timeout with a certain taxonomy term selected?

After applying all core and contrib module updates to an old Drupal 6 installation (updated to 6.32), creating or updating a node with one specific taxonomy term now fails with: "Fatal error: Maximum ...
0
votes
1answer
46 views

How to create multi sites

I have just started to learn Drupal. So, I apologize to ask such a silly question here. I wanted to create multi sites in Drupal. I have unlimited access to create Subdomains, Parked Domains, Addon ...
0
votes
2answers
41 views

Can't correctly reference bundle in EntityFieldQuery, field_get_items

I'm using EntityFieldQuery in an attempt to query for specific field values (dates in an event db) then perform some analysis on them. I've gotten far enough to correctly query and return specific ...
0
votes
1answer
11 views

how do i rename multiple content at once with find and replace same issue in names?

I imported about 15,000 pieces of content and didnt realize that the "&" in many titles are "&" and " ' " (apostrophes) are displayed as "'" Is there a way to replace all of these at one ...
0
votes
2answers
103 views

how to output image file from database drupal 7?

I have created testing module that will upload image and outputting it to my page. but, I can't seem to output my image file from my database. here's my code function database_ex_menu() { $items = ...
0
votes
1answer
15 views

Where is saved the value of the 'help text' of field of content type?

I know that you can set help text for any field in the content type, but where this text is saved in databese, because I want to access it in other way not only for tooltip? Thanks
0
votes
1answer
48 views

White screen of Death after clearing cache, can't find a way to get the site back up

My problem is that I keep getting the white screen of Death ever since I cleared the cache of my Drupal website. The error is the following : PHP Fatal error: Call to undefined function ...
0
votes
1answer
45 views

What is the preferred way to delete large amount of data from a Drupal site?

We have a client site that currently has a very, very large data set in Drupal. We are working on generating a 'stripped' copy of the database to be used for testing new code by eliminating the bulk ...
0
votes
1answer
102 views

Create a MySQL view table on one database but fill with results from another database

I have 2 databases: myshop (the Drupal db) and myshop_migrate (the Migrate db). To make things tricky - both databases reside on different AWS instances. I need to create a mysql view on myshop to ...
1
vote
0answers
54 views

Custom migrate with cross database joins issue

I'm facing an issue when running cross-database joins whilst implementing a custom module using Drupal Migrate. The set up: I have 2 databases: myshop_migrate - the migrate db and myshop - the ...
0
votes
2answers
32 views

Safe to delete cache_form table while site is in maintenance mode?

My site has a very large database of 100MB, most of this is in a table called cache_form. Ive tried clearing the cache. When I try and run the cron I just get a white screen. My site is in ...
1
vote
1answer
21 views

Why do we duplicate field data in the field_revision_* tables when revisions are disabled?

Even with revisions turned off for a given content type, the field_revision_* tables for the fields each contain a single record that matches the corresponding record in the corresponding field_data_* ...
0
votes
2answers
44 views

Commerce: What field to join line_item in order to get product price in custom query?

I'm starting with line 'commerce_line_item' as a base table, and I want to get prices for each of the line item products attached to a Drupal Commerce Order, rather than just the order total. I need a ...
0
votes
1answer
19 views

Import a list of suscribers from Excel

I have a big problem with a database. I have a list of suscribers in an excel list with their names, phone and other info. I need to import that suscribers to my drupal website and use them for send ...
1
vote
1answer
54 views

Why are there so many settings.php files one in each folder or sub-directory?

I am Drupal newbie taking over a poorly documented D6 group of sites organized by sub-domains. In examining the dev.[domain].org/sites/ folder I discover folders: all, default, demo.[domain].org and ...
-3
votes
1answer
41 views

simplest way to read and write data in database table. [closed]

I am new to drupal. I need to know what is the basic way to read and write content to a table of drupal database. also, can we add/update/delete data from a table inside the same drupal database ...
0
votes
1answer
49 views

LEFT JOIN with db_select()

I'm trying to do a left join but it isn't working. I have 2 tables: TABLE profile - uid - pid TABLE field_data_field_naam - entity_id - field_naam_value I want to select the field_naam_value ...
0
votes
2answers
63 views

How to create sql alias in drupal 7

How do you achieve the highlighted 'node' alias when using the Drupal 7 database abstraction language? This is the original query produced by the view SELECT node.title AS node_title, node.nid AS ...
0
votes
3answers
50 views

What entity should entity_id be joined on?

I'm writing a complex custom query to get order information from a Drupal Commerce install for export. The table "field_data_commerce_customer_address" has a column "entity_id." I've tried to join ...