MySQL is an open-source, relational database management system. Use this tag for questions specific MySQL, not for saying "I am using MySQL."

learn more… | top users | synonyms

-1
votes
0answers
15 views

why this sql_query with FULL OUTER JOIN do not run for me? [on hold]

$sql = 'SELECT * FROM table1 FULL OUTER JOIN table2 ON table1.column1 = table2.column1;'; $result = db_query($sql); These lines of code do not run for me.. has anyone ...
0
votes
1answer
22 views

How could I do a FULL OUTER JOIN in drupal?

How can I do this code in Drupal? I cannot find how this code is writing in Drupal. SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name = table2.column_name;
0
votes
0answers
14 views

My code do not run with this 'join' [on hold]

I have an empty table which is called 'distinct'. Thiw table have some columns with name 'wid', 'variables' and 'timestamp'... I have the following code : // Begin building the query. $query = ...
0
votes
0answers
37 views

how to write a db_select query in drupal? [closed]

i want to write a db_select query in drupal, but still its not working. $sql=db_query('SELECT * FROM `file_managed` WHERE `filename`LIKE '%.pdf' OR `filename`LIKE '%.doc' OR `filename` LIKE '%.doc' ...
0
votes
0answers
19 views

My server has 48 GB of RAM: how can I make use of it with Drupal? [closed]

By happy chance I was able to secure a dedicated server at my hosting provider with 48GB of RAM. We're running Debian 7 and the machine is Linux 3.0.20-xenU on x86_64; Intel Xeon CPU E5620 @ 2.40GHz, ...
0
votes
1answer
13 views

How to restrict a page to a group of people?

I am trying to figure out how I can lock down a page (part of my site) to a list of users that I have in another MySQL DB. Ideally I would like to call the DB and see if the user has access each time ...
0
votes
0answers
17 views

Concat query used in a like condition

I'd like to perform a query where I get the value of various fields(stored in different tables) and check if a string exists on them. This is part of a bigger query. What I did until know is : ...
0
votes
1answer
27 views

how do i install drupal with drush

First off, I'm a drush newbie, just installed it and now I want to install drupal on my server, so I did a drush dl drupal --drupal-project-rename=Quaaoutand next I want to do a drush si standard ...
0
votes
0answers
9 views

Recurrent error MySQL writing to /tmp

Need some brains to point me in the right direction please. I've been having a problem with a legacy Drupal 6 set up, recently it has started erring with the following Can't create/write to file ...
-1
votes
1answer
40 views

drush has no connection to mysql

i have a problem with drush to enable or disable module. Download Modules works perfect! but i want to use drush in its full range. Yesterday, i see my drush will not connect to the database. i ...
0
votes
2answers
28 views

Batch deleting nodes breaks database

On my Drupal site, I have about 100 nodes that need deleting. I have deleted them via Views Bulk Operations. When I do this, if I make a backup of my site MySQL database and then try to restore it ...
0
votes
0answers
34 views

db_select sum operation of multiple tables column

I have two tables table 1 is table 2 is I need sum of points and sum of pur_amount of each uid as per the vuid Here is my code $query = db_select('table1', 'pp'); $query->join('table2', ...
0
votes
1answer
19 views

Does Drupal cache db_query results for multiple users?

I am running into something strange and perhaps someone here can help me. I am trying to prevent two things from happening at once because the second attempt might be influenced by the first attempt. ...
3
votes
0answers
40 views

Drupal Commerce causing database deadlocks

I'm trying to get to the bottom of a known Drupal Commerce bug to do with row locking. When a user logs in on my development site, Drupal Commerce starts multiple identical queries that look like ...
0
votes
2answers
25 views

Adding Placeholders for PHP variables

When creating a query using db_query in my module I want to make sure it's as secure as possible. So I'd like to use placeholders in my 'WHERE' clauses. The problem I'm having is how to use ...
0
votes
1answer
51 views

Run a Drupal website offline (±without server)? — E.g. hand it over on a usb-stick / by mail? — Run it from the HD, while retaining functionality?

Why run Drupal offline? Since I use free webhosting, I don't have 100% up-time, so I started wondering whether I could maintain such Drupal functionality, while at the same time working offline. An ...
2
votes
3answers
65 views

Git-like way of updating Drupal database

It's easy to update Drupal on the local / remote server using Git. However, sometimes when I make modifications in the actual module settings or any other settings on my local server – those are ...
3
votes
4answers
132 views

How can I find a module or activity that is excessively writing to the database?

Problem: We have two productions servers: primary and failover. The two machines are linked via mysql replication. The mysql relay logs are clogging and bringing servers down the failover server. I ...
0
votes
0answers
29 views

How can I stop this query from being run by commerce module whenever I enable or disable new module?

I have a drupal commerce site that I created NOT with kickstart that has about 500K downloadable products (pdfs) and product displays. Whenever I disable or enable a new module, the multiple copies ...
0
votes
1answer
26 views

Problems with SQL Syntax using Left Join and OR

I need some help with my SQL. I've got the following code but it's returning multiples of each item and I don't understand why. When I only include the first Left join it returns results as ...
0
votes
2answers
37 views

My php is showing a numeric value for my list field…Why?

In a form I'm trying to take a value a user selected from a radio button and compare it with what's in the database. The value for the radio button is stored in $form_state['storage']['level']. The ...
0
votes
0answers
23 views

Moving New Content from Local to Remote Prod Site

I have a local development Drupal site using WAMP to build. I moved it over to Bluehost successfully. But now I would like a process to regularly update my remote site with local changes I'm making. I ...
0
votes
1answer
54 views

Displaying Database Data Within the Flow the Site

I have a multi-page form that works fine in and of itself (pathfindertool.module). However, once a user clicks submit I want the page to display some records on the page. And it DOES display the ...
0
votes
0answers
5 views

Is geographical Mysql replication doable in Drupal

I have a website with 3 languages : fr/en/ja. I would like to have 2 database server (or 3 ?) : - DB Server A : manages traffic for fr/en - DB Server B : located in Japan - manages traffic from ja. ...
0
votes
0answers
28 views

How to fix encoding mismatch problem

So I had a local testing Drupal installation, which uses a MYSQL database version which supports utf8mb4 encoding. I deployed this local site to the remote server by copying the files and database, ...
1
vote
1answer
59 views

drush sql-dump gives warning

When I ran drush sql-dump --result-file, it came back with a warning and a success message. system(): Cannot execute a blank command exec.inc:36 [warning] Database dump saved to ...
0
votes
1answer
28 views

SQL replace() function in PDO

I'd like to convert the instructions from this answer into a general script that can be reused across projects. I'm wondering how these commands can be written in Drupal 7 PDO format: UPDATE ...
0
votes
1answer
34 views

What MySQL privileges would a read-only drupal db user need [closed]

I am in the process of configuring a server that will be on the front end and will be the read-only installation. Can anyone give me some guidance on what to look for for in regards to what tables ...
0
votes
0answers
18 views

How to move Drupal7 website on Bitnami stack?

I want to transfer my Drupal7 website from one local machine to the other. I have prepared database dump using BackUp&Migrate module. However, I can`t open website front page after putting the ...
0
votes
1answer
189 views

MySQL 5.1 to MySQL 5.6 Update Causes php-cgi Error in Drupal 7 - PDO Issue?

I recently performed a MySQL upgrade on Windows Server 2008R2. I moved from MySQL 5.1 to MySQL 5.6.22 (Community Edition). (NOTE: PHP is currently 5.3.0) Things went just fine for all my WordPress ...
0
votes
1answer
35 views

Drush sql-sync failing with Ubuntu 14.04

I'm having no luck with sql-sync, there's two seemingly unrelated errors it's throwing at me which I'll detail below. I've been successfully sql-sync'ing the same site to another server, so I'm ...
0
votes
0answers
17 views

Cleaning database after Import

I imported millions of nodes (ca. 3 Millions) but i needed to abort sometimes and continue the Import. (like RAM resources) The Import is correct but i did a look into Drupal 7 Database and saw that i ...
0
votes
1answer
162 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: ...
0
votes
0answers
40 views

Using a different local non-Drupal database to store entities?

So we have a simple mysql database that stores information about people, which is used by multiple sites on our environment. I'd like to use entities to interact with this database, but I can't figure ...
0
votes
1answer
53 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: ...
0
votes
0answers
18 views

Condition not working

I'm trying to do a sql which is $sql ="Select r.* FROM event_mgmt_registration r WHERE event_nid = $node->nid AND reg_id = $reg_id"; in drupal (as below) $node = node_load($nid); ...
0
votes
0answers
24 views

Drupal Views Relationship in Code

I am trying to write a custom relationship between two tables for Views, and it doesn't seem to be working. The code for my relationship is this: $data['gov_data_bill']['sponsor'] = array( ...
0
votes
1answer
126 views

Converting MySQL to db_select with subquery count

I have an SQL query, with subquery, that returns as set of nodes ordered by referenced nodes... It works fine in a db_query, but I need it to be dynamic, and it feels like a better idea to use ...
0
votes
1answer
311 views

Your web server does not appear to support any common PDO database extensions

I'm trying to install Drupal7 or Drupal8 and keep getting this error: Database support Disabled Your web server does not appear to support any common PDO database extensions. Check with your ...
0
votes
2answers
39 views

Can drupal be installed on a subdomain and used on the main domain?

I was thinking about installing Drupal on admin.myexample.com for clients to access an add and edit news posts & products. Then just using myexample.com as the main site. Calling the database and ...
0
votes
1answer
39 views

Collecting user and node locations seperate or combined?

In my drupal site i like to have the location of users stored as well as the location of nodes. To store these locations i am using Geofield in combination with adressfield. Adressfield collects the ...
0
votes
1answer
68 views

How to exclude the user table using the drush sql-sync command

How do I exclude Drupal's user table from drush's sql-sync command?
0
votes
1answer
92 views

Drupal Commerce Kickstart 2 Mysql problem: “Table XYZ is marked as crashed and should be repaired” [closed]

My drupal kickstart 2 site occasionally cause Mysql errors. This is what Drupal Logs say: "PDOException: SQLSTATE[HY000]: General error: 145 Table './MYSITE/field_revision_body' is marked as crashed ...
0
votes
0answers
34 views

Drupal Quickstart / Drupalpro - mysql misconfigured to “drupalpro” user

I've been trying to do a drupal quickstart-create database and its creating the database, but it only shows up on the root account, but its not creating it on the current user's account "drupalpro" ...
0
votes
3answers
144 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
votes
0answers
20 views

On click of checkbox send email to selected recipients [duplicate]

<?php if( isset($_POST['Submitter']) && !empty($_POST['Submitter']) ) { $to = "syz@gmail.com"; $subject = "Test Subject"; $body = "Test Body"; $headers = "From: ...
0
votes
0answers
88 views

Database issue with Drush aliases on Windows

I'm having issues getting the drush sql-sync command working, and it seems to be related to how my site aliases are set up. When I try to run the sql-sync command with my local and production aliases, ...
0
votes
2answers
242 views

Drush can't connect to local MySQL through socket on WAMP

Trying to set up Drush with in a local dev environment on Windows 7 and can't get MySQL properly configured. A test command I've been running via Cygwin, with the resulting error, is as follows: $ ...
0
votes
1answer
40 views

Loading a large node body sequentially for better performance

I have a few very large nodes on my Drupal 7 site. In some cases the body field contains about 2MB of raw HTML (about 250,000 words). Despite the site performing well as a whole, the sheer size of ...
0
votes
2answers
52 views

Using db_select to only get the latest nodes with a certain field value

I have extending a query function for a D2D migration. The nodes have a field on them for a certain type of ID. In the old D6 site the the field did not have to be unique, but in the new D7 site the ...