justgotpaid
Programmer
Hello all. Im trying to bring back a row of data from a mysql table based on a filename field which is a varchar datatype. But Im not using the actual string, which happens to be wav1.wav but a variable name which was assigned to the string, i.e. the str below. It doesnt like this. HOwever if I replace the str with: ....FILENAME = 'wav1.wav'") then its fine. Any clues? Using Java by the way.
ResultSet rs = stmt.executeQuery(
"SELECT FILENO,FILELOC,FILENAME FROM METADATA WHERE FILENAME=" + str);
ResultSet rs = stmt.executeQuery(
"SELECT FILENO,FILELOC,FILENAME FROM METADATA WHERE FILENAME=" + str);