Now we need to add some more logic. Verify, if at least one row has been affected, instead of `!isset($data['link'])` check (in you do not do that, it is possible, that php will throw an error):
```php
if ( $db->sql_affectedrows() ) 
```
Inside the condition body, add new condition (and please, use `!= ''` instead of `empty()` check:
```php
if ( $data['link'] != '' )
```
and now, inside the second condition, you can run the query.