Categories
Mastering Development

I have made a login system, however, I don’t know how to style some of it

So, I have been working on a login page, and it has been working beautifully so far. However, I cannot style where the error message appears. Here is the code: — The login.php file — <?php include_once ‘../resources/session.php’; include_once ‘../resources/database.php’; include_once ‘../resources/utilities.php’; if(isset($_POST[‘loginBtn’])){ // array to hold errors $form_errors = array(); // validate $required_fields = […]

Categories
CMS Mastering Development Wordpress

Admin user column sort by numeric meta key

I try to sort a custom user field (team_user_id), I have all data but I can’t sort by numeric. updated code add_filter(‘manage_users_columns’, [$this, ‘custom_id_column’]); add_filter(‘manage_users_custom_column’, [$this, ‘custom_id_content’], 10, 3); add_filter(‘pre_get_posts’, [$this, ‘sort_content’]); public function custom_id_column($columns) { foreach ($columns as $k => $v) { if ($k === ‘username’) { $new_columns[‘ID’] = __(‘ID’, ‘default’); } $new_columns[$k] = […]

Categories
Linux Mastering Development

How to sort and compare 2 csv files column by column and move the difference to third file using shell scripting

file1.csv table_name,column_name,data_type common_lot,trend_date,date common_lot,context_date,date common_lot,lot_id,number file1.csv table_name,column_name,data_type common_lot,trend_date,date common_lot,context_date,number common_lot,lot_id,varchar2 Expected output is: table_name,column_name,data_type common_lot,context_date,number common_lot,lot_id,varchar2

Categories
Database Development

How to search entire database to find tables that contain 2 columns?

This database query doesn’t work: select table_schema, table_name, column_name, column_name2 from information_schema.columns where column_name = ‘user_id’ and column_name2 = ‘organisation_id’ and table_schema = ‘brand_production’; I would like to search for each table in the database to see if it contains "user_id" and "organisation_id"?

Categories
Database Development

MySQL How to Script to create indexes on all date columns in database

I have a lot of tables in the database that are using a datetime stamp – I need to create a script that will create indexes on all columns in each table that does not already have an index . So far I can get all the columns of type date, time etc.. I can […]

Categories
CMS Drupal Mastering Development

Updating custom field with module upgrade gives a “Page not found”

I have been working for quite some time on a custom module. So far I have always been able to reinstall everything from scratch, but now I need an update to a custom field. Following the indications in Manually Downloading Module or Theme Files and in Updating a Module I created a mymodule.install file with […]

Categories
CMS Drupal Mastering Development

Updating custom field with module upgrade gives a “Page not found”

I have been working for quite some time on a custom module. So far I have always been able to reinstall everything from scratch, but now I need an update to a custom field. Following the indications in Manually Downloading Module or Theme Files and in Updating a Module I created a mymodule.install file with […]

Categories
Mastering Development

Read csv file in spark with comma in fields

I have the following data, for which I need to prepare a schema file to read the data in spark. id, date, producttype, description 1, 02/01/2020,Standard,[“ABC, PQR”] 2, 03/02/2020,Standard,[“ABC, PQR”] 3, 20/02/2020,Standard,[“ABC, PQR”] The schema file I prepared is: COLUMN_ID, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE, PRECISION, DATA_SCALE 1, id, NUMBER,,N,38,0 2, date,VARCHAR2,15,N,, 3, producttype, VARCHAR2,10,N,, 4, […]

Categories
CMS Development Wordpress

Custom column in user table displaying total comment count

I need a custom column in the user table displaying the total comment count of approved comments of each user. I know how to do this using a plugin, but I would rather use a snippet in the functions.php. I know how to add a column and make ist sortable, but I can’t figure out […]

Categories
CMS Development Wordpress

Show MD5 Password in user section

Im trying to show the MD5 Password of the users as you see them in the database but in the users table as an extra column. I have previusly done with the ID like this: add_action( ‘plugins_loaded’, ‘cmr_suid_execute’ ); function cmr_suid_execute(){ add_filter(‘manage_users_columns’, ‘cmr_suid_add_uid_col’); function cmr_suid_add_uid_col($columns) { $columns[‘user_id’] = ‘ID’; return $columns; } add_action(‘manage_users_custom_column’, ‘cmr_suid_show_uid_col_data’, 10, […]