I've been trying to do some work with generating SQL commands with an interactive bash script and have a multiline string that I need to escape for use with MySQL.
Notes has already been defined as a multi-line string.
notes=$(echo "$notes" | php -r 'echo mysql_escape_string(fgets(STDIN));');
However, only one line is being returned. How can I get my multiline string properly escaped and returned?