mysql – I need to remove duplicate SQL values ​​Left Join

It is not possible to display in the desired format (without a lot of extra work and without assuming that there are still as many locations as there are job categories).

However, using GROUP_CONCAT will allow you to return a line by user name containing all the information you want, regardless of the number of categories and locations.

GROUP_CONCAT(job.category) AS job_categories,
GROUP_CONCAT(locations.location) AS locations
FROM users
INNER JOIN job ON users.username = job.username
INNER JOIN locations ON job.username = locations.username

He will return results like:

5   Don   Fashion/Design/Beauty,Eng,Arts/Audio/Video Technology        Mr,Colombo,gm

Young, one of two unique and British girls [duplicate]

This question already has an answer here:

  • Where can I find other RPG players?

    16 Answers

  • How to find a friendly and inclusive role play group online?

    2 answers

  • Looking for RPG players online for a face-to-face RPG campaign?

    7 Answers

Well, I am 13/14 years old, I am a beginner in a football club and I know enough Internet to be quite spawned. I live in Cambridge England and I really want to find a good group. I have never played before, but I start a biweekly campaign at a boys' club (except me and one of my best friends) Warhammer and Dnd. It's warhammer a week and dnd the next and so on. I have a story, drawings and statistics for my elven character, but I want to find a safe place where I could possibly join. Charged schedule but the play can be done. I'm open to dirty jokes, swear words and all that, but I live with my parents, so yes. Sorry if it sounds like an ad, but I'm really looking for nerds to relax and play trpg!

Ranking for an ideal query reducing [duplicate]

This question already has an answer here:

  • How to diagnose a decline in search engine rankings?

    5 answers

  • What are the best ways to increase the position of a site in Google?

    24 Answers

I'm trying to classify myself in the SERP for the query "t-slot aluminum" or "t slot aluminum". I began to see progress and I peaked at a position of 15.2 on August 11th. Since then, my ranking has gradually decreased. I saw the biggest drop on August 15th.

I have not done anything significant to reduce this ranking. The only thing I changed was the addition / removal of a Facebook pixel. In the last three weeks, the pixel is no longer in the file of the page.

Does anyone see what could potentially be wrong? I have no errors in the search console.

Always choose a larger file for duplicate downloads in Jdownloader2?

I download a very large number of image links in Jdownloader2 (hundreds at a time.) You have to parse each URL to get the images, and it also finds the thumbnails, which have the same file name as the images in size. real.

I can use the file size linkgrabber filter to delete some thumbnails, but the difference in size between thumbnails and full images is such that I can not use it to delete all the thumbnails (the thumbnail of the thumbnails). a particular image is smaller than this image, but some full-size images are smaller than other thumbnails.)

As a result, when a duplicate duplicate file is invariably downloaded, JDownloader asks me if I want to keep the current file or replace it. Sometimes, it first downloads the image at full size (larger), in which case I want to keep the current file. Sometimes it downloads the thumbnail file (smaller) first, in which case I have to overwrite the current file.

By the way, each url creates a separate package name, so I can not choose to rename the file and check the "Remember this package" box.

Is it still possible to set rename the file as the default option for all cases, or set it so that it prefers the larger file in each case, so that it stops asking this question? In this way, I do not have to watch the download for hours and answer the same question hundreds of times, with a potentially different answer for each question!

I am a Nigerian citizen who goes to Italy and I have a permanent stay. I am married to an Italian citizen, can I go to the UK without a visa? [duplicate]

This question already has an answer here:

  • Can I travel to the UK with my Italian daughter and my husband with my permesso di soggiorno?

    1 answer

I am a Nigeria who goes to Italy and I have a permanent residence permit and I am married to an Italian citizen, can I travel to the UK without a visa?

Calculate the maximum resolution that a camera can shoot [duplicate]

This question already has an answer here:

  • Does the number of dpi reported by the camera in JPG make sense?

    6 answers

  • Is there a practical difference between saving at 300ppi or 72ppi?

    5 answers

I'm trying to determine what DPI a certain camera can shoot, namely this model, but the technical specifications on the official website do not give details about it.

Is there any way to calculate the maximum possible DPI that a given camera can film provided that we have the type of sensor and its number of pixels (exactly as in the link above)?

ajax – MySQL Duplicate Entry for Updating Non-Unique Columns

In WordPress, I want to update the amount of +1 if the record already exists in the cart (query in code).

Three columns are unique in the table. When updating qty the column gives a duplicate entry error in this code. However, if I use the direct query from the console, it is updated qty value without error.

Also this method, I'm calling in AjAX. This returns undefined (probably ajax error).

So, how can I get this code works with Ajax, if no record that insert otherwise update the qty value by +1

$this->gs_db is the database class instance and $this->gs_db->db is $wpdb

product_group BIGINT(20)                       NOT NULL,
qty           INT(11)                          NOT NULL,
group_id      BIGINT(20)                       NOT NULL,
group_admin   BIGINT(20)                       NOT NULL,
group_user    BIGINT(20)                       NOT NULL,
added_at      DATETIME DEFAULT NOW()           NOT NULL,
INDEX pg_cart_index (ID, product_group, group_id, group_admin, group_user),
UNIQUE pg_cart_unique (product_group, group_id, group_user)
 * Add product group into the cart
 * @param int      $group_id      group id
 * @param int      $product_group product group id
 * @param int|bool $group_user    group user / logged in id
 * @return int inserted row id if new else update row id
public function add_pg_to_cart($group_id, $product_group, $group_user = FALSE)

    $this->group_id      = $group_id;
    $this->qty           = 1;
    $this->product_group = $product_group;
    $this->group_admin   = $this->group_id;
    $this->group_user    = ($group_user) ? absint($group_user) : absint(get_current_user_id());

    // check if record is already exists
    $query = "SELECT * FROM wp_gs_pg_cart WHERE product_group = '%d' AND group_id = '%d' AND group_user = '%d'";

    $prepare = $this->gs_db->db->prepare($query, $this->product_group, $this->group_id, $this->group_user);
    $result  = $this->gs_db->db->get_row($prepare);

    if ($this->gs_db->db->num_rows > 0) {
        $this->qty += $result->qty;

        $this->gs_db->db->update($this->gs_db->get_pg_cart_table(), ('qty' => $this->qty), ('id' => $result->id), '%d');

        $this->id = $result->id;
    } else {

        // setup data to insert
        $this->data = (
            'product_group' => $this->product_group,
            'qty'           => $this->qty,
            'group_id'      => $this->group_id,
            'group_admin'   => $this->group_admin,
            'group_user'    => $this->group_user,

        // setup data format
        $this->format = (

        // insert record
        $this->gs_db->db->insert($this->gs_db->get_pg_cart_table(), $this->data, $this->format);

        // get the id for inserted record
        $this->id = $this->gs_db->db->insert_id;


    return $this->id;

function gs_pg_add_to_cart_ajax()

    // Check if user is logged in
    if ( ! is_user_logged_in()) {
        // throw error if user is not logged in
        wp_send_json_error(__('Please login to order', 'group-shop'));

        // we use this manually as want to print error

    // check and validate nonce
    if ( ! check_ajax_referer('gs_nonce', 'nonce', FALSE)) {

        // throw error if validation fails
        wp_send_json_error(__('Do not be nasty with validation', 'group-shop'));

    $group_id      = 0;
    $product_group = 0;
    $cart_id       = 0;

    // validate product_group
    if ( ! isset($_POST( 'product_group' )) || empty($_POST( 'product_group' )) || $_POST( 'product_group' ) <= 0) {
        // throw error if validation fails
        wp_send_json_error(__('Product Group is not defined', 'group-shop'));
    } else {
        $product_group = absint($_POST( 'product_group' ));

    // validate product_group
    if ( ! isset($_POST( 'group_id' )) || empty($_POST( 'group_id' )) || $_POST( 'group_id' ) <= 0) {
        // throw error if validation fails
        wp_send_json_error(__('Group is not defined', 'group-shop'));
    } else {
        $group_id = absint($_POST( 'group_id' ));

    // initialize cart object
    $cart = new Group_Shop_Cart();
    // insert record
    $cart_id = $cart->add_pg_to_cart($group_id, $product_group);

    // if record inserted
    if ($cart_id > 0) {

        // show success message once record inserted
        wp_send_json_success(__('Product is added to cart', 'group-shop'));

    } else {

        // throw error if fails to insert record
        wp_send_json_error(__('Something went wrong', 'group-shop'));


    // stop further execution once all process done

(function ($) {

    $(function () {

        let response_alert = $('#response');

        $('form.gsGpAddToCart').on('submit', function (e) {

            let formData = $(this).serialize();


                method: 'POST',
                dataType: 'json',
                url: ajax_vars.ajax_url,
                data: formData + "&action=gs_pg_add_to_cart&nonce=" + ajax_vars.nonce,
                success: function (response) {


                    let response_alert = $('#response');

                    if (response.success === true) {

                    if (response.success === false) {

                error: function (response) {

                    let error_message = ( === undefined) ? 'Something went wrong!' :;
                    response_alert.fadeIn().prepend(alerts('error', error_message));
                complete: function () {

            return false;

        // control dynamically created error with JS - close/hide
        function gs_alert_stats() {
            let gs_alert = $('.gs-message');
            $('.gs-close').on('click', function () {



Javascript returns this error response Something went wrong! which is in error: function (response)

how to calculate a damage of a lead ball dnd 5th 3360 pounds [duplicate]

This question already has an answer here:

  • How can the weight of a falling object affect the damage that it causes?

    4 answers

  • If an object or creature falls on a monster, how much damage does each one suffer?

    2 answers

hay so i was tinkering and i discovered that a bigbys hand can stand 420 pounds and then i thought that while he was holding it was making the bigger one so i would increase / reduce to buf at 3360 pounds if idc bigbys hand was dispelled, he just dropped a very large lead ball (which carries spikes) on this poor goblin, so how much damage could it cause and how much can I get with this ball and yes, it's an old tactic in dnd nobody really says how much damage this could do thats why i'm here

Can I embed a spellcasting objective into a shield, such as a paladin or cleric? [duplicate]

This question already has an answer here:

  • Can I make an Arcane Focus Shield?

    3 answers

  • Can a multi-class spellcaster have one thing like two different homes?

    3 answers

I want to multi-class cleric / sorcerer or paladin / wizard and I was wondering if I could use my sacred symbol as a spellcasting target for my wizard spells. If not, can I incorporate my arcane focus into my shield as well as my sacred symbol. I plan to perform the feat of warcaster and be an arcane cleric if this can help you.