I have an `API` server, and I need to put all get data into data base

i use this code after connect to database:

```
foreach ($_GET as $key => $value)
$_GET[$key] = mysql_real_escape_string($value);

```

Is my code safe?