This gives a syntax error:
read -p "entry: " entry
sql="select concat('entry ', id) from mytbl where id = ?";
$mysql_conn "prepare stmnt from '${sql}'; set @id='${entry}';
execute stmnt using @id;deallocate prepare stmnt";
It works if used directly in mysql, but not through a bash script. If only id is selected it works. But concat() throws it off. It will also work if a direct query is made without a prepared statement. What gives?
Also tried:
select concat('entry ',?)
and pass @id but it failed too.