# Solution for Sell Delete Not Working Issue

## <span id="bkmrk-error%3A-deleting-sale-1">Error: Deleting Sale Not Working, shows “Something Went Wrong Please Try again Later”</span>

#### <span id="bkmrk-issue%3A-1">Issue:</span>

Sometimes, when attempting to delete a sale, the system may display the following error: **“Something went wrong. Please try again later.”**  
This usually occurs due to a database configuration issue.

### <span id="bkmrk-solution%3A-1">Solution:</span>

Follow the steps below to diagnose and fix the issue:

#### <span id="bkmrk-step-1%3A-check-the-er-1">Step 1: Check the Error Log</span>

Navigate to your application’s log file located at: **pos/storage/logs/laravel.log**

#### <span id="bkmrk-step-2%3A-identify-the-1">Step 2: Identify the Error</span>

If the log shows the following error: **General error: Prepared statement needs to be re-prepared**

#### <span id="bkmrk-step-3%3A-update-datab-1">Step 3: Update Database Configuration</span>

Open the database configuration file located at:

`pos/config/database.php`

Find the MySQL configuration block and ensure it includes the following option:

‘mysql’ =&gt; \[  
‘driver’ =&gt; ‘mysql’,  
‘url’ =&gt; env(‘DATABASE\_URL’),  
‘host’ =&gt; env(‘DB\_HOST’, ‘127.0.0.1’),  
‘port’ =&gt; env(‘DB\_PORT’, ‘3306’),  
‘database’ =&gt; env(‘DB\_DATABASE’, ‘forge’),  
‘username’ =&gt; env(‘DB\_USERNAME’, ‘forge’),  
‘password’ =&gt; env(‘DB\_PASSWORD’, ”),  
‘unix\_socket’ =&gt; env(‘DB\_SOCKET’, ”),  
‘charset’ =&gt; ‘utf8mb4’,  
‘collation’ =&gt; ‘utf8mb4\_unicode\_ci’,  
‘prefix’ =&gt; ”,  
‘prefix\_indexes’ =&gt; true,  
‘strict’ =&gt; false,  
‘engine’ =&gt; null,  
‘options’ =&gt; extension\_loaded(‘pdo\_mysql’) ? array\_filter(\[  
PDO::MYSQL\_ATTR\_SSL\_CA =&gt; env(‘MYSQL\_ATTR\_SSL\_CA’),  
\\PDO::ATTR\_EMULATE\_PREPARES =&gt; true, // Add this line  
\]) : \[\],  
\],  
**Important:** Make sure the line `\PDO::ATTR_EMULATE_PREPARES => true` is included under the `options` array. This setting helps prevent the “re-prepared” error by enabling emulation of prepared statements.

#### <span id="bkmrk-step-4%3A-save-changes-1">Step 4: Save Changes</span>

After updating the configuration save the file.