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

3
votes
1answer
87 views

Where should I be storing custom node-related data?

There are several types of data my website generates for every node. Node's popularity score, node's comment count obtained from a 3rd party API, etc... This data is set for every node. In the past ...
1
vote
1answer
23 views

Calling a procedure from drupal

I have a procedure structure like this in an Oracle database: procedure overlapping_course ( v_id number, v_program varchar2, v_message_type varchar2, v_user_type varchar2, v_language ...
0
votes
1answer
24 views

Drupal CMS Database recovering and starting up all the time - SQL Server [closed]

I have a problem since a couple days my drupal database goes crazy. It recovers and starts up almost every 10 minutes. I haven't touched the database really so there are no jobs running. From one day ...
0
votes
0answers
11 views

Master master replication, variable table breaks replication

We have a setup that requires master master replication for both HA and load balancing. I have excluded all cache tables from replication, although only cache_form is actually used because we run ...
0
votes
1answer
42 views

Does Drupal 7 support connecting to DB using MySQLi?

I have tried to connect to Mysql DB using Mysqli by declaring 'driver' => 'mysqli' inside DB array in settings.php but I get the following error: Warning: ...
1
vote
1answer
61 views

Populate dropdown with data from database in Drupal7 using jQuery

Error is seen when i made a drop down list to populate data from Database. Database : dtable File in the template of hook_theme named : myModueForm_theme.tpl.php <?php $sel = "<select ...
0
votes
1answer
16 views

Nested select with Drupals DataBase interface

I have the following SQL query and need to translate it to the drupal API: SELECT *, (SELECT COUNT(*) FROM newsletter WHERE email = pupils.email ) AS newsletter_flag FROM ...
0
votes
1answer
32 views

Query on custom drupal 7 field

I'm facing problem in Drupal query for order by custom field Here is my query $result = db_query('SELECT n.nid FROM {node} n WHERE n.type = :ntype', array(':ntype' => 'portfolio')); this work ...
0
votes
1answer
13 views

Migration failed with source plugin exception

I'm getting the following error: Migration failed with source plugin exception Migration failed with source plugin exception: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ...
1
vote
1answer
37 views

Is it possible to done search indexing locally, then upload it?

I want to perform search items indexing on the local system . Due to high number of items and And slowing down the server Can I do something like this , then I upload the result to the DB? Without ...
0
votes
0answers
22 views

Need help debugging a DatabaseSchemaObjectExistsException error

I'm getting this error both when I try to flush the cache and when i try to run update.php. I honestly have no idea where to start so any help is greatly appreciated. ...
1
vote
1answer
11 views

How to attach a database of data to a content / entity type

I have an sqlite database representing a collection of Foo which is immutable. I would like to be able to take this collection of Foo in the GUI of Drupal, and append a few fields onto each Foo ...
0
votes
2answers
21 views

how to connect to database for form submission

I have website and on its home page there is form in which user enter his own label .As user enters label if the user with same label exists in database it through message that "This Label already ...
1
vote
1answer
32 views

server migration issue

I've developed a website and deployed it in a server, I consider this server as a test server. Now, I'm in the final stage of development and I'm looking to move the website content to new server. In ...
0
votes
2answers
44 views

Database query in template.php

Is it ok to query the database in a template.php file of a sub-theme. If not where do I put it? Below I have function that is querying the database and it works fine but I want to make sure I doing it ...
0
votes
2answers
48 views

PDOException: SQLSTATE[42S02]: Base table or view not found

I am getting a PDO error which seems related to the Mass Contact module. I installed, played with and then disabled the Mass Contact module. Now when I run cron I get the error: PDOException: ...
0
votes
1answer
46 views

Update database with update module disabled

I have recently inherited a site which needs protecting from the recent security exploits. The site has not been very well maintained but the hosting company can provide me with a database dump from ...
0
votes
1answer
70 views

Create custom form and store form data into database [closed]

I am start working with Drupal just some days ago. I am really a amateur in Drupal . I just want to know how can I create a form in Drupal with textbox or check-boxes and store the value of the form ...
0
votes
0answers
17 views

Unable to login / Warning: array_flip(): Can only flip STRING and INTEGER values!

My site has completely become unusable as it's not allowing users to log in into the site. The problem happened when I truncated the accesslog, login activity tables from the database. Later I ...
0
votes
1answer
89 views

problem migrating my drupal site PDOException: SQLSTATE[42000] [1044] Access denied for user [closed]

I have just loaded my drupal 7.32 site to JustHost from my pc (running xampp) copied the files across, and exported and imported the database to JustHost cpanel, i browse onto the website and I get ...
1
vote
1answer
25 views

How can I recover from a backup but include many changes from a dynamic site?

After the Drupageddon disaster, I've discovered that my backup plan is not sufficient. I have daily, weekly, monthly and yearly DB and file backups thanks to backup_migrate and backup_migrate_prune, ...
0
votes
1answer
14 views

SQL command to remove hypens from data value

A commerce site that I am working on has products titles and skus in the format of DS-PC-CDJ2000. The client wants the each hyphen removing and replacing with a space; DS PC CDJ2000 There are ...
0
votes
0answers
14 views

ReCreated a Content Type but it does displayed

I seem to have run in to a problem when re-creating a Content Type, I had a Content Type called Gallery on my drupal 7.32 site, I then deleted it, but then wanted to create it again. When I re-created ...
0
votes
1answer
16 views

Retrieve a list of values from a lookup table using db_select

I have a "jobs" table where each job can have multiple specialties. So I have a specialties table with a list of all available specialties and I have a lookup table that just has a job_number and a ...
0
votes
1answer
22 views

How do you check if table is empty before resetting the auto increment

I have a database table that a user can add to and remove data from within my drupal module. What I would like to do is automatically check to see if the table is completely empty after every delete, ...
0
votes
1answer
23 views

Why won't my module table populate

I have a page that is supposed to output a table of values from my database. I am logged in as an admin and another page I created works just fine, outputting a form for data to be entered into the ...
0
votes
1answer
28 views

How do you render a table within a custom module in drupal?

I have a page on my Drupal module that is responsible for the input of goals to be completed by an admin. What I would like to happen is have all of the goals within the database table render below ...
2
votes
2answers
78 views

How to push form values to database in Drupal

I am building a drupal site in which I would like the admin to have the ability to input goals into a table on the drupal database that can then be output to other users to be completed. The form for ...
0
votes
3answers
51 views

Get all rows from database

I have the table where I store uid column, and I want to get all values from table, but I only get the frist elemnt, where is my problem ? My query: $sql = db_select('voting_nomination_counter', 'v') ...
1
vote
2answers
42 views

After migration the login form no longer submits, why?

I have been working on a Drupal 7 site on localhost (via WAMP) for some time now. Recently I wanted to migrate this website onto a new machine and continue working on it there. The steps I took: I ...
0
votes
1answer
13 views

What query string is used to display products in commerce kickstart?

I am creating a php script to display all the products from commerce kickstart database But the image is in a table called file_managed and the products are in commerce_products and i cant seem to ...
2
votes
1answer
35 views

How can I substitute field in hook_query_alter?

I have a query, with a date field, let's say it is aliased as enabled. And joined table with field enabled_for_website. In my query alter, I want to substitute global enabled with date specific to ...
0
votes
1answer
19 views

Use an existing Drupal site to create a new site

Today I tried to copy a existing Drupal site for creating a new one on a other domain-name. The problem: the new website still uses the old DB. So if I create a new user for example, this user also ...
0
votes
2answers
44 views

Manage database and draw Graph

Iam new to Drupal. I need help , because as a beginner i want to create a website which need to store lots of information. And from the collected information ( statistics ), i want to map a Graph out ...
1
vote
1answer
130 views

Make a direct database query

Basically I want to run this query against the current database and retrieve all node titles with node type of foo_type. SELECT title FROM node WHERE type='foo_type' ORDER BY title ASC How can I do ...
0
votes
1answer
25 views

Removing file from form breaks site

I created a module that hooks into the admin menu and allows you to upload a specific file for the site to use. It allows you to upload a file, and change a file, but as soon as you remove a file and ...
0
votes
0answers
18 views

Webform Submission & Commerce Order Database Relations

Where is the relation between Webform Submission ID & Commerce Order ID in the drupal database? The problem is one of my orders crashes after editing the webform so I guess that the relation ...
-1
votes
2answers
30 views

Drupal database: how to join 2 tables?

Currently I'm learning drupal database command as I'm pretty new to Drupal, I'm more familiar with mysqli api. I want to check the role of user before they are logged in to the system, the role table ...
0
votes
0answers
26 views

Why is my database table not being created with hook_schema?

I have a custom module called inventory. I disable the module, then uninstall, and finally reinstall. But, the database table inventory_defaults never shows up. Do you have any idea why the ...
0
votes
1answer
26 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
1answer
62 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
218 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
32 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
40 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
35 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
79 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
50 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
128 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
237 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
99 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 ...