Hot answers tagged

10

As far as I know ExpressionEngine will use one or the other, SHA1 or MD5 (I believe SHA1 is the default). In my test it actually worked to use either one when replacing the password, allowing me to login just fine in both cases. You can use MySQL to generate a new password hash for yourself. For example either SELECT SHA1('pass123') or SELECT MD5('pass123') ...


8

What you're referring to is the auto increment value in a table. You can change this by running the following query: ALTER TABLE mytable AUTO_INCREMENT = X ...where X is the next number you'd expect for your IDs. This is a database-level change and not something ExpressionEngine has as a "feature". Only make this change if you understand you might break ...


8

The problem is that many developers don't know how to write compliant SQL statements - they're software developers who find themselves also filling the role of database developers. This problem crops up in many addons and was recently fixed in EE core code. For Assets v2.6 Change line 615 of ft.assets.php FROM: $sql = "SELECT DISTINCT a.source_type, a....


7

If the item uses the same field_group, you can generally switch channels via the edit menu. Go to the 'Edit' Menu, Select the Entry, while in the Entry, Select the Options Tab. The choice of channels you can move the item to is listed. See image. Additionally, if you were going to do it via query, you need to update multiple database tables: ...


6

There is a setting under Admin → Channel Administration → Channels → Edit Preferences - under the Comment Posting Preferences header - for Comment Expiration. Set a number of days there, and tick the box for "Update all existing comments with this setting" (which should more accurately read "existing entries"). To be clear this won't close ...


6

Given that the control panel for comments (Add-ons > Modules > Comments) is a little limited in its date filtering, and if you have lots and lots of comments it would be a chore, a query is probably the best route. A query that would close all comment entries before Sat, 01 Jan 2011 00:00:00 GMT: UPDATE exp_comments SET status = 'c' WHERE comment_date < ...


6

This is because all “id” columns in EE are set to AUTO_INCREMENT in MySQL. Expressionengine is never explicitly choosing what the next member/entry/etc.’s ID is going to be – MySQL assigns it automatically. MySQL stores the latest auto-increment value internally, and it won’t automatically drop it back when a row is deleted. Some tools like phpMyAdmin will ...


5

Make sure you’re running the latest version of Matrix. Matrix 2.5 came with a pretty drastic performance boost. http://pixelandtonic.com/matrix/releasenotes


5

I know you sorted this out, but for others who may wind up here looking for details: Say you have an entry with an entry_id of 10. That entry's channel has a Relationship field with a field_id of 20. While editing that entry, you choose a child entry from your Relationship field, which has an entry_id of 50. You'll end up with these values in your ...


5

This will definitely require a module. I recommend taking a look into the developer documentation to get a feel for this. I wouldn't write any code to do what you want without a plugin or module. It's not too difficult to get started. http://ellislab.com/expressionengine/user-guide/development/index.html You can use Pkg.io to make your life easier. This ...


5

Yes, that is the correct way to do it. To clarify this for others, you will need to open up PHPMyAdmin, or any other SQL client which will let you run SQL queries directly. You can also go to Tools > Data > SQL Manager > Database Query Form in the ExpressionEngine control panel. Then run this query, replacing 30000 with the order ID you want to assign to ...


5

UPDATE Since you would probably prefer to truly just move an existing category to a new group (and not create new ones and reassign entries as outlined below), this SQL is all you would need: UPDATE exp_categories SET group_id = X WHERE cat_id = Y OR parent_id = Y X = new category group Y = parent category that you want to move to new group The OR ...


5

My answer assumes you are for example trying to pull channel data manually. I'm not entirely sure of the OOP / Foreign key part of the question. First you need to understand the exp_channel_titles and exp_channel_data tables. I will only go into the information that's relevant for basic database interaction. exp_channel_titles contains the basic entry ...


5

I believe this is what you're looking for: SELECT exp_channel_data.entry_id AS entry_id, exp_channel_titles.title AS title, exp_channel_titles.url_title AS url_title, GROUP_CONCAT(cp.cat_id SEPARATOR '|') AS categories FROM exp_channel_data LEFT JOIN exp_channel_titles ON exp_channel_titles.entry_id = exp_channel_data.entry_id LEFT JOIN exp_category_posts ...


4

That should be as simple as this, using the correct channel_id: Update exp_channel_data set field_id_46 = concat(field_id_41, '|', field_id_42) where channel_id = 1 For the Maps table, it's something like this: Insert into exp_mx_google_map (entry_id, lat, long, some_example_field) Select entry_id, field_id_41, field_id_42, 'Some example value' from ...


4

I think you would need a subquery to make this happen select cd.field_id_XX as first_name, cd.field_id_XX as middle_name, cd.field_id_XX as last_name, cd.field_id_XX as suffix, ct.author_id as member_id from exp_channel_data as `cd` left join exp_channel_titles as `ct` on cd.entry_id = ct.entry_id where cd.channel_id = "XX" and (select count(*) FROM ...


4

This should cover it. SELECT field_id_49 as 'First Name', field_id_50 as 'Last Name', field_id_51 as 'Email', field_id_56 as 'Date of Birth', field_id_53 as 'Occupation', field_id_52 as 'Gender', field_id_57 as 'Address', field_id_58 as 'Address 2', field_id_59 as 'City', field_id_60 as 'Postal Code', field_id_54 ...


4

You can use the channel fields api to get the field names: ee()->load->library('api'); ee()->api->instantiate('channel_fields'); $fields = ee()->api_channel_fields->fetch_custom_channel_fields(); //change 1 to your site_id if using MSM $quantity_field_id = $fields['custom_channel_fields'][1]['your_quantity_field_name']; $sql .= "picd....


4

You can do this by developing your add-on as a module rather than a plugin since only modules can use EE actions. (See the EE docs for an explanation of the difference between the types of add-on.) More info on EE actions here. Essentially, you need to develop a module to perform your desired action, then call the associated ACT URL (e.g. http://example....


4

You can make a module - like Steve advice. Use Yeoman ExpressionEngine Add-On generator to simplify developing process. On server you will need to setup cron with wget: execute cronjob every day at 3am 00 03 * * * wget http://example.com/index.php?ACT=XX&task_id=1 Or if you want something really quick and simple: Create a special template with some ...


3

First thought was we'd add a config var for the MySQL port as per the CodeIngiter docs $db['default']['port'] = 5432 but that didn't work instead we had to change the hostname to $db['expressionengine']['hostname'] = "mysqldbinstance.hostname.com:4703";


3

You have to update the exp_channel_titles table too.


3

To get a total of all occurrences across all comments: SELECT SUM(LENGTH(comment) - LENGTH(REPLACE(comment, '?', ''))) AS occurrences FROM exp_comments To get the count for each comment in a query result: SELECT LENGTH(comment) - LENGTH(REPLACE(comment, '?', '')) AS occurrences FROM exp_comments (MySQL doesn't have a specific function for this, but I ...


3

You should never have to reinstall addons locally if you are pulling files/DB from production properly. If you are having this problem, the issue is most likely related to how you are doing the migration. I'd suggest your errors are caused by your exported SQL not including DROP TABLE and you aren't manually dropping the tables in the DB before your import. ...


3

Sounds like a poorly coded template... First, you should aim to refactor it using the multi_add_to_cart_form instead of the simple add_to_cart_form: http://cartthrob.com/docs/tags_detail/multi_add_to_cart_form/index.html This will give you a single form for all 6 products so should reduce CT's load by 6X. You should then look into other optimisations and ...


3

Your best bet would be to attempt to repair the table via a database management utility outside of the EE control panel. Does your web host offer anything like a PHPMyAdmin interface, or do you have any experience with standalone MySQL clients like Sequel Pro? Those utilities should expose table repair functionality. I'd start there first. Before you ...


3

Can you define what you mean by "a modern CMS"? Any database driven system will face similar problems when using Git source control. This isn't specifically an ExpressionEngine problem. The only systems that wouldn't suffer this difficulty are those using flat file architecture. I often use Git with ExpressionEngine. The only possible sticking point being, ...


3

I ran it and I'm getting results just fine. Are you outputting the results correctly? $query = ee()->db->query('SELECT cat_url_title, cat_name, ch.channel_name FROM exp_categories c LEFT JOIN exp_channels ch ON ch.cat_group = c.group_id WHERE c.cat_name LIKE "%'.ee()->db->escape_str($keywords).'%"'); foreach($query->...


3

There's a similar post here But you could just look in the template debugging info. Another option would be to add something to each template that shows its name (either output to screen or as an HTML comment). Of course, you would then need to traverse the whole site and note which templates were used, and which ones weren't. Which would possibly be ...


2

Good answer to this issue by Brandon over at the original GetSatisfaction entry: https://getsatisfaction.com/pixelandtonic/topics/error_2006_on_submit Thanks again, Brandon.


Only top voted, non community-wiki answers of a minimum length are eligible