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
0answers
21 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
20 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
10 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
31 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
41 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
30 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
43 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
56 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
14 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
40 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
23 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
10 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
18 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
22 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
26 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 ...
0
votes
1answer
19 views

Creating item library, allowing user to make selections and publish to another page [on hold]

Above is a rough MS paint concept I banged out to illustrate what I'm trying to do. I need to create a library of items, which have pictures, descriptions, names, etc. This library will be ...
2
votes
2answers
66 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
45 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
38 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
12 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 ...
0
votes
0answers
19 views

How select id, name, image and price of product from commerce kick start database [on hold]

I'm working on a php script to get all the products and images from the commerce kick start database but it seems not to work here is iv tried SELECT * FROM `field_revision_commerce_price` , ...
2
votes
1answer
30 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
18 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
40 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
122 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
24 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
15 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
29 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
23 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
25 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
50 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
181 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
26 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
35 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
33 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
67 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
39 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
89 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
221 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
88 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
63 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
31 views

How to trim content from a heavy database [closed]

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
41 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
92 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
338 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
18 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
19 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 ...