开发者

mysql in bash with variable

How can i parse a variable in a mysql update statement in a bash script?

i have this but its not going to work

mysql -h HOST -u USERNAME -pUGUESIT -D DATABASE -bse "DELETE FROM table WHERE Pos开发者_JS百科ition='" . $4 ."'; DELETE FROM table WHERE Instance='" . $4 . "';" 

ofcourse username and pass etc are correct but not for public. The question is how I can use the $4 in the statement...

Thanks in advance!


You should be able to do it like this:

"DELETE FROM table WHERE Position='$4'; DELETE FROM table WHERE Instance='$4';" 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜