'Problem with php variable to using MySQL query

Two variables, one is $current_shop another is $shop (see below). Both are printed same value: "sps-app-test.com". But when I use them in the below SQL Update query, the $shop variable works fine by SQL condition, but when using the $current_shop variable, it does not work.

However, the store_url = 'sps-app-test.com'.

I have tried without success, and posted this problem in many other places.

$shopify = $_GET;
$current_shop = $shopify['shop'];
print_r($current_shop); // sps-app-test.com

$shop = "sps-app-test.com";
print_r($shop);
    
// form_title
if(!empty($_POST['form_title'])  ){
   
    $form_title = mysqli_real_escape_string($conn, 
    $_POST['form_title']);
   
    if( isset($form_title)  ){
        
        $query_form_title = "UPDATE widget_cont SET 
        form_title='$form_title' WHERE store_url='$current_shop'  ";

        echo  $_POST['form_title'];
        
    }
   
    if( !mysqli_query($conn, $query_form_title) ){
        echo "ERROR: " . mysqli_error($conn);
    }
}

More details in this image

MySQL row



Solution 1:[1]

Please try not to include image instead write the code and can you try this :

$current_shop = $_GET['shop']

since the error is from this one try to use $_GET without assign it to a variable

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aref Makke