Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql]

The tag has no usage guidance.

0
votes
3answers
34 views

1054 Unknown column error when upgrading from 3.5.15 to 4.3.6

Getting this error when upgrading from 3.5.15 to 4.3.6. Any ideas? SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ee_m_MemberGroup_member_groups.can_manage_consents' in 'field list': ...
1
vote
1answer
16 views

Cannot access sql manager

I cannot access sql manager on a site which is running EE v 4.0.8 I've checked the file permissions and they look fine. This is the error message. Any suggestions of what to check next? View file ...
0
votes
1answer
12 views

SQL help to remove an imported text error

We recently migrated a site, and any line break imported as /n. This was not a huge deal for the templates, but it is for the entries. This is for an EE3 site, and I just don't write SQL code that ...
1
vote
1answer
69 views

How to use an SQL query to display entries from last 45 days

I'm using the following SQL query to populate a filter form for a jobs site. The query displays all locations used in the jobs listed on the site. I'm only displaying jobs up to 45 days old on the ...
1
vote
1answer
91 views

Preventing SQL Injections

In a EE plugin if I construct a sql statement based on passed in parameters and use a EE->db->query($sql) call does the query function prevent SQL Injections or do I need to change my code to use some ...
0
votes
0answers
87 views

Exception Caught, SQLSTATE[42000] - Solspace Favourites

Just installed Favourites on a freshly updated EE3 install. When trying to get to the settings of the add-on, I get this thrown in my face :/ SQLSTATE[42000]: Syntax error or access violation: 1055 ...
3
votes
1answer
120 views

Mass-change entries from one status to another

We cannot bulk-edit entries via the CP, and I need to make a change in my workflow. In one channel, I need to mass-change all entries whose current status is OPEN to CREATED, if the entry-date is ...
1
vote
2answers
93 views

Removing duplicate entries using an SQL query

I'm trying to create a search field (using Solspace Super Search) using a location from existing channel entries. Unfortunately this results in duplicate locations as some entries use the same ...
1
vote
0answers
341 views

EE3 - Exception Caught error

Getting the following error after moving site to local server. Same db and site files. DB settings configured. Any idea what the issue is? Exception Caught SQLSTATE[42S02]: Base table or view ...
0
votes
1answer
57 views

Automated deployment (Wordmove for EE)

I've been trying to figure out a way for executing automated deployment of EE sites via Capistrano or similar. I've come across various tutorials but all require Git on the server, and most don't ...
0
votes
2answers
34 views

How to use the SQL Manager to find which extensions use a certain hook?

How would I go about using the SQL manager to find out which extensions use a specific hook? I can't find any documentation or query examples on this...
1
vote
1answer
26 views

SQL help - clear all the values of a specific field

We ran a batch import to pull in several hundred entries, but some fields got imported incorrectly. For example, all the websites imported as "link", when they should have been blank. Can someone ...
0
votes
1answer
114 views

SQL query in a channel:next/prev_entry to output an image in a matrix column

I'm trying to create a Prev / Next navigation system using thumbnail images. The images for each entry are held in a four column matrix field (field_id = 8). I just want the first image held in the ...
1
vote
2answers
56 views

Playa related entries count

We are running reports and need a query - we're using playa and I want to get the total number of child_entries where channel_id = 16 and where the 'parent_field_id' = 68. My current query is: ...
0
votes
3answers
47 views

How to pass sql entry_ids to playa?

I trying have a SQL query pass some information to a playa. I can fetch the entry ID and even the field output, but can't pass to exp:playa: Here is a cleaned up snippet of the call {exp:query sql="...
0
votes
1answer
70 views

SQL Query Not Displaying All Results

I am setting up a search by author section on the blog for my website. I have all the code set up correct, and people are showing up! However, not everyone is showing up. When I run the SQL Query ...
1
vote
1answer
77 views

MX Select Plus CE - problems with SQL Query

I've added MX Select Plus CE in a Matrix row. The objective is when the user is digitizing inside the select options, appears "on the fly" the "title" of theses entries of a specific channel. I chose ...
0
votes
2answers
114 views

Is there a way in Expression Engine to bulk close entries that contain a specific string?

I have old data that has been migrated into a new design. The old data contains multi-language data using 4 different languages and Transcribe. The new site does not contain transcribe, nor does it ...
0
votes
1answer
128 views

SQL query issue while trying to count the entry (row)

Trying to produce a current entry count / total entries within a channel_entry tag by using a SQL query. {exp:channel:entries channel="{channel}" limit="1" require_entry="yes" status="open" ...
0
votes
1answer
103 views

Matrix & EE 2.9.2 SQL Error

I am using version 2.9.2 EE and Matrix 2.6.1 (both the latest versions of each software). Each time I try to publish a channel entry that has a Matrix fieldtype I am getting the following error ...
0
votes
0answers
81 views

Show entries where relationship field equals Yes with the Query

I have 2 channels, one called artists and another called gallery. In the artists channel there is a checkbox to say if the artist has given permission for their work to be shown. In the gallery ...
2
votes
2answers
755 views

Advantage of ActiveRecord over plain sql query

Can someone tell me the advantage of using ActiveRecord vs writing a plain sql query?
1
vote
2answers
39 views

AJW-Export date formating in CSV is off 6 hours

I'm using ajw_export for my CSV, I have: DATE_FORMAT(from_unixtime(exp_channel_data.field_id_454), '%h:%i') AS Start_Time, works but shows time with 6 hour difference. I have tried: DATE_FORMAT(...
0
votes
1answer
135 views

AJW Export download button

I am using the Add-on AJW Export to export member details in CSV format. Each time the page loads the CSV format downloads automatically. Anyone any suggestions how to activate the download via a ...
0
votes
0answers
273 views

Weird 'A Database Error Occurred' when editing certain entries

I have a very strange error as the title suggests. I am hoping someone might have come across it and found a fix. On only certain entries, if I edit them, I get: A Database Error Occurred Unable to ...
0
votes
2answers
62 views

Sql query to pull list of channels

I know this is a simple answer, but I can't remember the exact way to write an SQL query to use in a custom field for displaying a list of channels currently on the site. A Google search on the topic ...
0
votes
0answers
21 views

Batch Title Rename Help

All of our records (30-40 k) got uploaded with non descriptive titles in a certain channel and I want to properly rename them in either Sequel Pro or EE. I haven't used SQL in a while so I need help ...
0
votes
1answer
373 views

Displaying Category Name and Channel Entry Data with Query Module

I have a SQL query set-up to display a list of entries based on the category ID found in the third segment, but I'm having a hell of a time trying to display the category name that goes along with it. ...
0
votes
2answers
43 views

Searching channels

First time on an EE project, I want to build a search for my channel on the front end. Which is best way to achive this? 1 -sql via a form is this an option? 2 - 3rd party module 3. advanced search ...
1
vote
1answer
534 views

How to add categories to a SQL query that outputs channel entry data

I'm trying to create a query that will output all the entries in a channel. I'm wanting to output the title, some custom fields, and the categories that the entry belongs to. Each entry will belong to ...
2
votes
1answer
2k views

Get all entries where expiration date is within last 12 months

I know this is more of a SQL question, but I'm having trouble getting EE to cooperate. I have entries that expire, and want to show only entries which have expired in the last 12 months. I tried: ...
5
votes
1answer
240 views

How to prevent CartThrob from making hundreds of SQL queries and running extremely slow?

this may be somewhat of a noob question as I just started administering an ExpressionEngine site that uses CartThrob. My client complained of the site being slow during the shopping / checkout process ...
1
vote
1answer
76 views

Bulk Entry Time Change

I've just switched my localization settings for the Daylight Savings folderol. (Something that, admittedly, I haven't done in previous years.) This year, I have over 200 entries in the queue that had ...
0
votes
1answer
50 views

Get categories that contain entries that are in the current category

How can I get a list of categories that share entries with the currently selected category. Huh? Let me explain I have a channel called Portfolio Portfolio channel has two category groups (client ...
1
vote
1answer
387 views

Help with SQL to Export Channel entry status

I've built an accessory to allow my client to export channel entry data to a CSV. All is working fine but they now want to add the entry status to the list of exported fields and I'm having trouble ...
1
vote
4answers
188 views

Quick and safe way to delete all entries with a given status?

Due to a data grab import that went a bit awry I find myself with approx 10000 entries that I don't want! They've all got a specific status. I'm currently deleting them in batches but the most I can ...
0
votes
1answer
96 views

SQL to get entry_id in exp_channel_data based on member_id

I have custom channel named foo that is connected to the the members via safecracker and safecracker registration. In a hook I am making, the member_id of a person is available to me. Is there a way ...
0
votes
1answer
164 views

Where in the database do I find channel_short_name

I'm trying to write a custom SQL query like this: {exp:query sql=" SELECT channel_short_name FROM what_table_is_it_in WHERE entry_id = '{embed:entry_id}'" } {channel_short_name} {/exp:...
1
vote
1answer
264 views

SQL query syntax incorrect?

This doesn't give me an error, but it also doesn't display any results. I'm trying to display only the entries that don't have a relationship. My relationship field is field_id_57, and I only want ...
1
vote
1answer
144 views

Building a list of entries from a single category with exp:query

I'm trying to speed my site up with a few direct queries. Like: {exp:query sql="SELECT field_id_16 FROM exp_channel_data WHERE channel_id='4' "} {field_id_16} {/exp:query} What query will ...
0
votes
1answer
1k views

SQL query getting entries from current day

I am trying to use this script that I have put together, forgive me I am a bit of a newbie with sql. When I run the script it is outputting an empty csv file, only showing column titles, no data. ...
0
votes
1answer
133 views

Limiting query module results by member group_id

I am trying to limit the following query by the member's group id, but having some difficulty with the join statement. This query works fine: {exp:query sql="SELECT count(*) as member_count, ...
0
votes
1answer
457 views

How do I pass a variable to mySQL without using the query module?

I can echo the current entry_id but when I try to pass that variable to a mySQL statement, it doesn't work. {exp:channel:entries channel="test" entry_id="20"} <?php $entry_id = '{entry_id}'; ...
3
votes
3answers
7k views

$this->db->last_query() not picking up the right query

I've got a Active Record query which i need to grab the sql from, so i'm doing the query and then i'm doing for example $query = $this->EE->db->select('foo')->get('bar'); $bob = $...