MySQL Forums
Forum List  »  Italian

Passare una variabile a una query di mysql
Posted by: peppe pegasus
Date: May 20, 2009 07:28AM

Ciao,

è la prima volta che scrivo qui e spero qualcuno di buona volontà mi possa aiutare..sto scrivendo un programma bash di linux..devo fare una query su un database Mysql e devo passare una variabile, il codice che uso è

risultato=`mysql --user=giuseppe -pgiuseppe DB_sodar -Bse 'SELECT nome_file FROM tab_database WHERE nome_file = '\ ""$nome_file""\ '' `

la variabile (di bash) è nome_file, come faccio a passarla alla query come variabile appunto? Con questo codice mi restituisce come risultato della query sempre il nome dell'unico file presente nel database.
Help me.
grazie.
ciao.

Options: ReplyQuote


Subject
Views
Written By
Posted
Passare una variabile a una query di mysql
6039
May 20, 2009 07:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.