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

1
vote
1answer
15 views

How to create a Webform pre-build option list via a query to an external database?

I'm trying in Webform (version 4.9) to create a pre-build option list with data from an external database. A pre-build option list is an available list you get when creating a "select options" field ...
1
vote
0answers
22 views

How can I setup multiple database connections in Drupal 8?

Can anyone help me to setup connection with multiple databases connection in Drupal 8? I have database on the same server and I want to access it along with default Drupal 8 database.
0
votes
1answer
22 views

What is the maximum number of sql queries on a HTTP request? [on hold]

I'm working on a titanium app with a drupal back office, now It's the web service part (with services module), I've just finished the "registration form" on the mobile app (that send information to ...
0
votes
1answer
16 views

avoid duplicated records with drupal_write_record

I want to test drupal_write_record, the insert part is ok, but this function seem to duplicate records. How to make a condition for if new record is already stored ? some like db_merge with key ...
0
votes
0answers
11 views

Drupal Data Base table missing [duplicate]

can anyone let me now if i could create tables manually on my Data basem and if yes how can I do it, just that one of the tables is missing, thanks
0
votes
0answers
25 views

The website encountered an unexpected error. try again later

Hi guys I get this message when trying to get acces to my web loging as admin this is the error The website encountered an unexpected error. Please try again later. is only when trying to get access ...
1
vote
0answers
22 views

My node.title differs from the title field in the database

I have a wierd problem i can't seem to get a solution to. I have a Drupal 7 website with more then 10000 nodes. And i recently discovered that 2000 of them have exactly the same typo in the title. So ...
1
vote
1answer
18 views

Difference between drupal_write_record and db_insert

I want to know what is the difference between drupal_write_record and db_insert example : can i translate that drupal_write_record('MyCustomTable', $Myrecord, $primary_key); to an insert query ? ...
0
votes
1answer
19 views

Drupal table name prefix

Is there a required format for table name prefix? I know that in MySQL installations it must end in an underscore like prefix_ but I want to know if that is also the required format for Postgres and ...
0
votes
1answer
14 views

How to map uid in users table data to the entityid in feild table to retrieve data of the users in drupal7

I would like to retrieve data related to users with the uid in users table. But the uid is not mapped in the feild_data tables which has entity_id and entity_type. How are these two ids mapped in ...
0
votes
2answers
24 views

Update database after feeds' import

Hello Drupal community, I'm trying to develop a customized module that updates the database with some operations on some fields (geocoding an adress field) after an import using feeds. Any idea which ...
0
votes
1answer
11 views

How to get each db result value count

How to get values count in db_select My query is: $last_item = '2015-07-19'; $query = db_select('field_data_appointment_date','ap'); $query->join('field_data_appointment_slot','aps','aps.entity_id ...
3
votes
5answers
78 views

How to restore complete database keeping the site in maintenance mode in Drupal 7

I need to restore complete database in a regular basis (weekly). I am using pure PHP + system call to mysqldump and mysql to backup and restore full database. The restore process takes 2 minutes. What ...
-1
votes
2answers
60 views

db_query and db_select

I have static query (db_query works great) but for some reason, I have to put a condition to the query result I don't want to re-write the same db_query with "where", I'm looking for a way to write ...
0
votes
1answer
29 views

db_select sub query

I need to use sub query on db_select but, as you can see the sql, I think the first select should be like db_select('tabe1','tab') but this table is a "virtual" table I've to create temporary only for ...
1
vote
1answer
22 views

How do I add a COALESCE to a db_select?

I want to achieve the following query using db_select(): SELECT Column1, Column2, COALESCE(Column1, Column2) AS Column3 FROM TEST_ATTRIBUTES How do I add the coalesced column to the ...
0
votes
1answer
29 views

Store query result on an array

this is a simple query $sql = db_select('node','n'); $sql->fields('n', array('uid','title')); $s = $sql->execute(); I need to check the uid of all records : if('n.uid' !=1 ) { do some ...
0
votes
2answers
20 views

Where can I change this value?

I'm trying to change the phone number displayed in sidebar window with the chinese lady in it. However I'm trying to find out where it's content is coming from. This is how the HTML looks <div ...
0
votes
0answers
15 views

Links to show Portfolio of sites

I would like to make a Drupal site where I can make a list of sites using views, where when you click on one of the site links it would show the concept site that I have made. I will be utilizing ...
2
votes
1answer
30 views

Error when trying to extend a db_select query

I'm trying to add a field to my query by using addField(). However, whenever I add this to the query I get a whitescreen and an apache error message on the line after. Any help in resolving this would ...
0
votes
1answer
11 views

Is necessary any sanitization functions if I use the database layer correctly

In Writing secure code said: Use the database abstraction layer to avoid SQL injection attacks Then, my question: When I get value for a user form is necessary pass to check_plain() or others ...
1
vote
2answers
53 views

How to make higher the value of the field nid in the node table in database?

I'm using feed to import node from other system. This system uses very long number for its node id, like: 17675272378. As you can count this number has 11 digits. The problem is that Drupal allows nid ...
2
votes
1answer
36 views

How do I store large volumes or data points using Drupal ( temperature and humidity points )

I'm trying to use Drupal as a headless API, and so far I'm having good results. One of the things I'm collecting is a Temperature and Humidity data. Thus far I've created an entity that can hold the ...
0
votes
1answer
17 views

Automated database history save and recovery Drupal 7

I have a site implemented in Drupal 7. I want to make a history database recovery tool, which will recover previously recorded MySQL data. I have tested correctly on non-Drupal content which is used ...
1
vote
0answers
31 views

Drupal store into own database

Using Drupal 7 and trying to store registration information into my own database. I have a hook_form_submit() function that should be submitting the information into my own database table. what it ...
0
votes
1answer
33 views

Add a link into a drupal header and table

I am currently in the process of creating a free sports betting site, and I would be able to manage the matches. For this, I create a table with the data from my table, but I would add a column to ...
1
vote
0answers
15 views

Updating Secondary Database Drupal

How can I update a secondary Drupal database when a node of certain type is updated? I am using Rules module to get this done. Here is my event and actions. Event - After updating existing content of ...
0
votes
0answers
38 views

Cannot get the real author of a node through node_load() in drupal 7

this is a weird one... I have been using node_load('NID') for a few months now in my custom modules and it has always worked all right. The past two days however, something strange is going on. When I ...
0
votes
0answers
26 views

Use OrderBy in Query

I want to retrieve only the latest course of the student which is BSCS in my semstudent table, so I sorted it out by using orderBY sy and sem. Below is my code: $query = db_select('student', ...
0
votes
1answer
14 views

Query a list of field values of a node in drupal 7

I am new to drupal 7, I have a question and hope to receive your helpful responses! :D I've created a new content type named 'school', and create a custom 'city' field in it. After that, I create two ...
0
votes
1answer
21 views

Update database to Drupal 6 to Drupal 7

I upgraded my website to D6 to D7 successful but only with the development version (not in production) and I've new datas in production since (Drupal 6). So i'm wondering the best way for update the ...
0
votes
1answer
57 views

Multisite: Share users and user roles for existing set up

I have made a Drupal 7 multi-site with 3 sites. Each site is running of the same Drupal install and has a separate database. The database names are myhost_site1, myhost_site2 and myhost_site 3. (My ...
1
vote
2answers
28 views

How can I build a contact form which will save its input to MySQL?

How can I build a contact form which will save its input to MySQL? Is there any relevant module you'd recommend?
-1
votes
2answers
57 views

drupal 7 default table to store form values [closed]

I am new to drupal and creating a module consist of a form. Now I want to store values in database, please tell me what is the default table in drupal to store form values? Like in WordPress we have ...
1
vote
1answer
17 views

Find user profile page link from database

I know the link structure of a user page . Like For admin,it is example.com/users/admin But I want to know from database how can I find the link? or which table contains the link?
0
votes
0answers
27 views

Update query not working

In a Drupal 7 custom module, I am updating a record in the database using a form, and I am using the following code to update, but for some reason it is not updating. Who can help me out? When I ...
1
vote
2answers
71 views

drupal_mail to users selected from database

In my Drupal 7 site I use custom tableselect form to manage some events. User can review profiles of people who applied for event and approve their participation. I want to send them email ...
0
votes
0answers
33 views

dropdown ajax field not save fileds on databasse

I am trying to create my own module and I'm having trouble saving information in the database. in fact, the values are stored in the database, but the first value of the array (String) (violin) If I ...
1
vote
3answers
133 views

Differences between 'Add existing field' and 'Add new field'

It is possible to reuse the already created fields via Add existing field option. From optimization perspective and the way Drupal stores and manages such fields in database I would like to know, does ...
0
votes
0answers
40 views

Update failed - table doesn't exist

I'm running a D7 core update and all but one database updates pass. The one that doesn't pass gives me the following error message: Failed: DatabaseSchemaObjectDoesNotExistException: Cannot add field ...
0
votes
0answers
57 views

Getting error Fatal error: Call to undefined function _system_rebuild_theme_data()

I am getting this error on a Drupal 7 site on running a cron script from command line. The site is running on multisite configuration having subdomains like http://site1.example.com ...
1
vote
3answers
29 views

Error after transfering process to a new host

I transfered my website to a new host and I am seeing this error: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'teise1_katalogas.system' doesn't exist: SELECT name, ...
1
vote
2answers
36 views

Outside Database

I have an outside database called "panels" that stores our company articles/blog posts/products etc... in it. Is there a good module to use, or I could write a custom module to hook into the outside ...
0
votes
0answers
27 views

Insert “uuid” in “users” table

I am building a web-service which will register user for my drupal site from android device. For Registration I am inserting data in the 'users' table of Drupal database. But the problem occurs with ...
0
votes
0answers
42 views

Combine results from two views with working pager

I'm looking for how to combine two views with working pager. I've searched a lot but all examples are for db_select or without pager. I have a node type "Company" with fields: "Main Category", term ...
0
votes
1answer
26 views

Overview & help with drupal files and folders on Win 7

I am a newbie. Please forgive me if this is a dumb question. I'm trying to wrap my brain around what is Drupal and how it works. I installed Acquia Dev Desktop successfully on my Win 7 computer. I ...
0
votes
1answer
29 views

Between Query is not working

My query is like so: $result = db_query("SELECT nid as id,created as start,title FROM node WHERE (created BETWEEN '1430134906' AND '1430129127')"); foreach ($result as $record) { ...
0
votes
2answers
36 views

Why doesn't the field table in the Drupal database use entity_id as a primary key?

I'm working on trying to optimize a View SQL query and I noticed that the query being executed is using a join on a the entity_id field of a field table. I noticed that for some reason unbeknownst to ...
0
votes
0answers
46 views

Drush won't use password for DB connection; how to set it to use password and define password?

I can't figure out why and where Drush is set/configured not to use password when connecting DB. For instance I was trying setup a quick site e.g. command drush qd which gives: PDOException: ...
1
vote
2answers
73 views

Fetch data from database and show in custom block [closed]

I have created my own simple block.I want to show some data from user table of database of logged in user to the block.I want to show it programmatically and not want to use any module. How can I do ...